0
Database DesignObjectivesIn this lesson, you will learn to: Map an entity-relationship diagram to tables in relation to th...
Database DesignConceptual Model Reflects entities and their relationships, based on the data  processing needs of an organ...
Database DesignMapping Entity-Relationship Diagrams to Tables A database that conforms to an E/R diagram can be  represent...
Database DesignRegular Entities They can exist in isolation, independent of any other entity They are the “building blocks...
Database DesignAttributes Each property or attribute shown in the E/R diagram  maps to a column in the appropriate table©N...
Database DesignRelationships Each type of relationship maps to tables in a different  manner in the relational database ma...
Database DesignRelationships (Contd.) Are of the following types:     One-to-One     One-to-Many     Many-to-Many©NIIT    ...
Database DesignWeak Entities A weak entity is an entity whose existence depends on  some other entity It cannot exist if t...
Database DesignSubtypes and Supertypes Each entity type (subtypes and supertypes) maps to a  separate table The primary ke...
Database DesignTips on Logical Database Design Attributes:     Do not introduce any unnecessary attributes     An attribut...
Database DesignTips on Logical Database Design (Contd.) Keys:     Relational systems require keys that uniquely identify t...
Database DesignTips on Logical Database Design (Contd.)     Any attribute (or set of attributes) that uniquely      identi...
Database DesignJust a Minute… Define the following terms:    a. Candidate Key    b. Alternate Key ©NIIT                   ...
Database DesignTips on Logical Database Design (Contd.) Entities:     Some attributes may acquire further attributes durin...
Database DesignProblem Statement 2.P.1 Map the E/R diagram to its corresponding tables©NIIT                               ...
Database DesignSummaryIn this lesson, you learned that: The conceptual model reflects entities and their  relationships. D...
Database DesignSummary (Contd.) The mapping of relationships depends on the type of  relationship. Each type of relationsh...
Database DesignSummary (Contd.) A weak entity is an entity whose existence depends on some  other entity. A subtype is a s...
Database DesignSummary (Contd.) To simplify multiple references, a new superentity should be  introduced; this is also cal...
Upcoming SlideShare
Loading in...5
×

Rdbms xp 02

836

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
836
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Rdbms xp 02"

  1. 1. Database DesignObjectivesIn this lesson, you will learn to: Map an entity-relationship diagram to tables in relation to the following: Regular entities Attributes Relationships Weak entities Subtypes and supertypes©NIIT RDBMS/Lesson 2/Slide 1 of 19
  2. 2. Database DesignConceptual Model Reflects entities and their relationships, based on the data processing needs of an organization Can be mapped to a relational, hierarchical, or network model Is independent of individual applications, database management systems, hardware, and physical storage of data©NIIT RDBMS/Lesson 2/Slide 2 of 19
  3. 3. Database DesignMapping Entity-Relationship Diagrams to Tables A database that conforms to an E/R diagram can be represented by a collection of tables in the relational system The mapping of E/R diagrams to tables can be discussed in relation to the following: Regular entities Attributes Relationships Weak entities Subtypes and Supertypes©NIIT RDBMS/Lesson 2/Slide 3 of 19
  4. 4. Database DesignRegular Entities They can exist in isolation, independent of any other entity They are the “building blocks” of the database Each regular entity maps to a table©NIIT RDBMS/Lesson 2/Slide 4 of 19
  5. 5. Database DesignAttributes Each property or attribute shown in the E/R diagram maps to a column in the appropriate table©NIIT RDBMS/Lesson 2/Slide 5 of 19
  6. 6. Database DesignRelationships Each type of relationship maps to tables in a different manner in the relational database management system The most important principle is to create tables where information from the real world is stored and retrieved in an optimal way; that is, a minimum number of tables with a minimum number of attributes In a relational system, a join operation retrieves all information by combining two or more tables©NIIT RDBMS/Lesson 2/Slide 6 of 19
  7. 7. Database DesignRelationships (Contd.) Are of the following types: One-to-One One-to-Many Many-to-Many©NIIT RDBMS/Lesson 2/Slide 7 of 19
  8. 8. Database DesignWeak Entities A weak entity is an entity whose existence depends on some other entity It cannot exist if the entity on which it depends does not exist©NIIT RDBMS/Lesson 2/Slide 8 of 19
  9. 9. Database DesignSubtypes and Supertypes Each entity type (subtypes and supertypes) maps to a separate table The primary key of the supertype is the foreign key of the subtype It creates a link between the two The foreign key of the subtype is also its primary key©NIIT RDBMS/Lesson 2/Slide 9 of 19
  10. 10. Database DesignTips on Logical Database Design Attributes: Do not introduce any unnecessary attributes An attribute serves three purposes: ® To identify its owner entity ® To refer to another entity ® To simplify the description of an entity©NIIT RDBMS/Lesson 2/Slide 10 of 19
  11. 11. Database DesignTips on Logical Database Design (Contd.) Keys: Relational systems require keys that uniquely identify the rows of a table. There are various types of keys: ® Primary ® Foreign ® Candidate ® Alternate ® Composite©NIIT RDBMS/Lesson 2/Slide 11 of 19
  12. 12. Database DesignTips on Logical Database Design (Contd.) Any attribute (or set of attributes) that uniquely identifies a row in a table is a candidate for the primary key. Such an attribute is called a candidate key. Any attribute that is a candidate for the primary key but is not the primary key is called the alternate key. Keys can be simple or composite ®A simple key is composed of a single attribute ®Acomposite key, on the other hand, comprises two or more attributes©NIIT RDBMS/Lesson 2/Slide 12 of 19
  13. 13. Database DesignJust a Minute… Define the following terms: a. Candidate Key b. Alternate Key ©NIIT RDBMS/Lesson 2/Slide 13 of 19
  14. 14. Database DesignTips on Logical Database Design (Contd.) Entities: Some attributes may acquire further attributes during database design and become entities. Subentities: Replace optional attributes of an entity with subentities. This is called specialization. Specialization is the result of taking a subset of a higher- level entity set to form a lower-level entity set Generalization is the result of taking the union of two or more lower-level entity sets to produce a higher‑level entity set.©NIIT RDBMS/Lesson 2/Slide 14 of 19
  15. 15. Database DesignProblem Statement 2.P.1 Map the E/R diagram to its corresponding tables©NIIT RDBMS/Lesson 2/Slide 15 of 19
  16. 16. Database DesignSummaryIn this lesson, you learned that: The conceptual model reflects entities and their relationships. Data analysis helps determine entities and relationships. The conceptual model is independent of the system where it is to be implemented. Regular entities are not dependent. They can exist in isolation, independent of any other entity. Each entity maps to a table. Each attribute in an E/R diagram maps to an attribute in a table. Entities with common attributes should be merged. Attributes may acquire further attributes and become entities.©NIIT RDBMS/Lesson 2/Slide 16 of 19
  17. 17. Database DesignSummary (Contd.) The mapping of relationships depends on the type of relationship. Each type of relationship maps to tables in a different manner in the relational database management system. In one-to-one relationships, one instance of an entity can relate to only one instance of the related entity. In a one-to-many relationship, one instance of an entity can relate to more than one instance of the related entity. Many-to-many relationships map to tables. One-to-one relationships are not very common and may map to foreign keys in tables.©NIIT RDBMS/Lesson 2/Slide 17 of 19
  18. 18. Database DesignSummary (Contd.) A weak entity is an entity whose existence depends on some other entity. A subtype is a subset of another entity. A subtype is always dependent on supertype for its existence. The primary key of the supertype is the foreign key of the subtype. It creates a link between the two. A candidate key is a candidate for the primary key. An alternate key is a candidate key that is not a primary key. Optional attributes should be replaced with subentities; this is also called specialization.©NIIT RDBMS/Lesson 2/Slide 18 of 19
  19. 19. Database DesignSummary (Contd.) To simplify multiple references, a new superentity should be introduced; this is also called generalization.©NIIT RDBMS/Lesson 2/Slide 19 of 19
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×