Your SlideShare is downloading. ×
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/

1,043
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,043
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/ Lecture 12 Friday, March 14, 2008
  • 2. Story So Far…
    • What is Object?
    • What is class?
    • Core ASP.NET Objects
  • 3. Introduction to DBMS
    • A database management system ( DBMS ) is computer software designed for the purpose of managing databases. Typical examples of DBMSs include Oracle, DB2, Microsoft Access, Microsoft SQL Server,
    • Collection of interrelated data & a set of program to access those data.
    • Goal is to provide way to store and retrieve data in an efficient and convenient manner.
    • Word MANAGEMENT means- to provide mechanism for:
      • Defining structure for storage of information.
      • Providing mechanism for manipulation of stored data.
    • Safety Mechanism
  • 4. Database System App.
    • Banking
    • Airlines
    • Universities
    • Credit card transactions
    • Finance
    • Manufacturing
    • Human resources
    • Sales…
  • 5. Tables
    • Databases consists of many related tables.
    • Table contains a part of data.
    • Table can be thought of as a class.
    • Each row can represent the instances of the class.
  • 6. Entity Relationships
    • A database can be modeled as:
      • a collection of entities,
      • relationship among entities.
    • An entity is an object that exists and is distinguishable from other objects.
      • Example: specific person, company, event, plant
    • Entities have attributes
      • Example: people have names and addresses
    • An entity set is a set of entities of the same type that share the same properties.
      • Example: set of all persons, companies, trees, holidays
  • 7. Attributes
    • An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set.
    • Domain – the set of permitted values for each attribute
    • Attribute types:
      • Simple and composite attributes.
      • Single-valued and multi-valued attributes
        • E.g. multivalued attribute: Degree : BA, BSc, PhD
      • Derived attributes
        • Can be computed from other attributes
        • E.g. age , given date of birth
  • 8. Composite Attributes
  • 9. Relationship
    • A relationship is an association among several entities
    • A relationship is a logical association between two types of entities.
    • Consider books and bookstores:
      • Bookstore orders books
      • Bookstore displays books
      • Bookstore stocks books
      • Bookstore sells books
      • Bookstore returns books
  • 10. Relationship…
      • One to One
      • One to Many
      • Many to Many
  • 11. Keys
    • Primary Key
    • The primary key is an attribute or a set of attributes that uniquely identify a specific instance of an entity. Every entity in the data model must have a primary key whose values uniquely identify instances of the entity.
    • To qualify as a primary key for an entity, an attribute must have the following properties:
      • It must have a non-null value for each instance of the entity
      • The value must be unique for each instance of an entity
      • The values must not change or become null during the life of each entity instance
    • Candidate Key
    • Any key or minimum set of keys that could be a primary key is called a candidate key.
  • 12. Keys…
    • Composite Keys
    • Sometimes it requires more than one attribute to uniquely identify an entity.
    • A (primary) key that made up of more than one attribute is known as a composite key.
    • Foreign Keys
    • An attribute that appears as a nonprimary key attribute in one relation and as a primary key attribute (or part of a primary key) in another relation.
  • 13. SQL
    • SQL stands for S tructured Q uery L anguage
    • SQL allows you to access a database
    • SQL can execute queries against a database
    • SQL can insert, delete, update & retrieve data from a database
    • SQL works with databases like MS Access, DB2, MySql, MS SQL Server, Oracle, etc
    • SQL is easy to learn…..
  • 14. SQL Database Tables
    • A database most often contains one or more tables.
    • Table is identified by a name (e.g. "Customers" or "Orders")
    • Tables contain records (rows) with data.
    • Example: Persons
    Stavanger Storgt 20 Kari Pettersen Sandnes Borgvn 23 Tove Svendson Sandnes Timoteivn 10 Ola Hansen City Address FirstName LastName
  • 15. SQL Queries
    • With SQL, we can query a database and have a result set returned.
    • A query like this:
      • SELECT LastName FROM PersonsGives a result set like this:
    Pettersen Svendson Hansen LastName
  • 16. SQL Queries…
    • SQL Queries are categorized into :
      • SQL Data Definition Language (DDL)
      • SQL Data Manipulation Language (DML)
  • 17. SQL Data Definition Language (DDL)
    • The Data Definition Language (DDL) part of SQL permits database tables to be created or deleted.
    • We can also define indexes (keys), specify links between tables, and impose constraints between database tables.
    • The most important DDL statements in SQL are: 
      • CREATE TABLE - creates a new database table
      • ALTER TABLE - alters (changes) a database table
      • DROP TABLE - deletes a database table
      • CREATE INDEX - creates an index (search key)
      • DROP INDEX  - deletes an index
  • 18.  
  • 19.