1 / 17

Entity Relationships

Entity Relationships. A337. Data Stores-Specific Diagrams. Included on both Flowcharts and DFDs There are also rules related to data stores. For example Can there be multiple invoices with the same number? Can a customer have more than one address?

jeri
Download Presentation

Entity Relationships

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Entity Relationships A337

  2. Data Stores-Specific Diagrams • Included on both Flowcharts and DFDs • There are also rules related to data stores. For example • Can there be multiple invoices with the same number? • Can a customer have more than one address? • Can an address belong to more than one customer?

  3. Relationships within the Relational Database Maximum Cardinality (the “outside” symbols) • 1:M relationship • M:N relationships • 1:1 relationship Minimum Cardinality (the “inside” symbols) • 0  optional • |  mandatory

  4. The 1:1 Relationship • One entity can be related to only one other entity, and vice versa • Could indicate that two entities actually belong in the same table • Sometimes 1:1 relationships are appropriate Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel

  5. The 1:1 Relationship Between PROFESSOR and DEPARTMENT

  6. The Implemented 1:1 Relationship Between PROFESSOR and DEPARTMENT

  7. The 1:M Relationship • Indicates that for every row in one table, there may be multiple related records • Depends on the situation • Customer to Address can be • 1:1 (e.g., HOA) • 1:M (e.g., Online retailer - mailing, billing, etc)

  8. The 1:M Relationship Between COURSE and CLASS

  9. The Implemented 1:M RelationshipBetween COURSE and CLASS

  10. The M:N Relationship • Implemented by using a pair of 1:M relationships • Can require creating a composite entity or bridge entity • Composite entity table must contain at least the primary keys of original tables

  11. The ERD’s M:N Relationship Between STUDENT and CLASS

  12. The M:N Relationship Between STUDENT and CLASS

  13. Changing the M:N Relationship to Two 1:M Relationships

  14. Converting the M:N Relationship into Two 1:M Relationships

  15. The Expanded Entity Relationship Model

  16. “Key” terms • An entity is something of importance to a user that needs to be represented in a database. • An entity represents one theme or topic and is represented by a table. • The table dimensions, like a matrix, consist of rows (tuples) and columns (attributes). • A table may be related to other tables (i.e., a relationship).

  17. Relationship Key Example Primary Key Relationship Foreign Key

More Related