Presentation is loading. Please wait.

Presentation is loading. Please wait.

Entity Relationship Diagrams

Similar presentations


Presentation on theme: "Entity Relationship Diagrams"— Presentation transcript:

1 Entity Relationship Diagrams
Used for conceptual data modeling - part of database design Represents: the data that is important the structure of the data the relationships between different pieces of data Does NOT show process, roles, users, etc.

2 Basic Elements Entities people, places, things
entity type is a set of things all of which have the same data properties entity instance is one concrete example of the entity type things that the system keeps track of, NOT things that are part of the system

3 Basic Elements (cont.) Relationships Attributes
show how instances of one entity are related to instances of another entity have cardinality and degree Attributes single pieces of data that describe an instance of an entity like data elements

4 Basic ER Diagram SSN street name city CUSTOMER owner type Has
account number ACCOUNT balance Basic ER Diagram

5 Composite Attribute Last Maiden Middle Title First Suffix Name
CUSTOMER Composite Attribute

6 Multivalued Attribute
Last Maiden Middle Title First Suffix Name Deductions EMPLOYEE Multivalued Attribute

7 Relationship with an Attribute
Effective Date Fills POSITION EMPLOYEE Relationship with an Attribute

8 Effective Date Employment History POSITION EMPLOYEE Associative Entity

9 child parent person parent Unary Relationship

10 Ternary Relationship type training Talent name Performer Performs
address Show dates location Ternary Relationship

11 Three Binary Relationships
type training Talent name Has Used in Performer address Show dates Performs in location Three Binary Relationships

12 Cardinality Constraints
Effective Date EMPLOYEE Fills POSITION Cardinality Constraints

13 A supertype and subtypes
account# balance account U U savings account checking account interest rate max overdraft A supertype and subtypes

14 model number model number model number make price make price make price fits uses LENS CAMERA FLASH film type requires requires quantity quantity BATTERY size type

15 U U U model number price PHOTO EQUIPMENT make fits uses LENS CAMERA
FLASH film type requires requires quantity quantity BATTERY size type

16 DateEnrolled DateEnrolled SSN SSN Degree STUDENT Graduation Date GRADUATE Grade TRANSCRIPT TRANSCRIPT Grade Date Date COURSE

17 U U Generalization DateEnrolled SSN Grade TRANSCRIPT STUDENT Date
COURSE U U Degree Graduation Date FORMER CURRENT Generalization

18 Part of a grocery store database
SUPPLIER Wastage SuppliedBy Has Ingredients ITEM Quantity Part of a grocery store database

19 U U U Specialization Quantity Has Ingredients ITEM BAKERY ITEM
SUPPLIED ITEM SuppliedBy PERISHABLE ITEM SUPPLIER Specialization Wastage

20 Part of a Zoo database DOB DOB LivesIn PRIMATE HABITAT BIRD Origin
Food LivesIn Origin LivesIn Food LivesIn 4-LEGGED ANIMAL REPTILE Origin Food DOB DOB Origin Food Part of a Zoo database

21 U U U U Specialization Origin Food DOB HABITAT LivesIn ANIMAL PRIMATE
BIRD 4-LEGGED ANIMAL REPTILE Specialization

22 Replacing a set of subtypes with an attribute
Origin Food DOB HABITAT LivesIn ANIMAL Class Replacing a set of subtypes with an attribute

23 Disjoint specialization
model number price PHOTO EQUIPMENT make type = type d “lens” “flash” U “camera” U U fits uses LENS CAMERA FLASH film type requires requires Disjoint specialization with discriminator quantity quantity BATTERY size type

24 Total, disjoint specialization
MOTHER Has OFFSPRING d U U BAD CHILDREN GOOD CHILDREN Total, disjoint specialization

25 Total, disjoint specialization with discriminator
MOTHER Has SentCard OFFSPRING SentCard = d “Yes” “No” U U BAD CHILDREN GOOD CHILDREN Total, disjoint specialization with discriminator

26 Overlapping specialization with discriminator
DateEnrolled SSN Grade TRANSCRIPT STUDENT Status Date Enrolled? Status: Graduated? COURSE o Enrolled=“Y” Graduated=“Y” U U Degree Graduation Date FORMER CURRENT Overlapping specialization with discriminator


Download ppt "Entity Relationship Diagrams"

Similar presentations


Ads by Google