Your SlideShare is downloading. ×
0
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
Introduction to DBMS ASP.NET http://sdetu/courses/sdetc101/
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,063

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

×