Presentation is loading. Please wait.

Presentation is loading. Please wait.

Levels of Database Modeling High degree of abstraction Conceptual model User view 1 User view 2 Implementa- tion model Physical model Medium degree of.

Similar presentations


Presentation on theme: "Levels of Database Modeling High degree of abstraction Conceptual model User view 1 User view 2 Implementa- tion model Physical model Medium degree of."— Presentation transcript:

1 Levels of Database Modeling High degree of abstraction Conceptual model User view 1 User view 2 Implementa- tion model Physical model Medium degree of abstraction Low degree of abstraction

2 Entity Relationship (E-R) Model E-R model is used for conceptual modelingE-R model is used for conceptual modeling Components:Components: –Entities/Objects –Relationships –Attributes –Domains (of attributes’ possible values) –Key attributes and non-key attributes »candidate key »primary key »secondary key »foreign key Entity set (type) versus entity instance (occurrence)Entity set (type) versus entity instance (occurrence)

3 A figure from the original Chen’s article DEPARTMENT EMPLOYEE DEPENDENT DEPT-EMP PROJECT SUPPLIER PART PROJ-WORK PROJ- MANAGER EMP-DEP PROJ-PART SUPP-PROJ -PART COMPONENT 1 N 1 1 N N N N N M M M M P N

4 Relationships Associations between entitiesAssociations between entities Names should be descriptiveNames should be descriptive Degree: the number of associated entitiesDegree: the number of associated entities –unary, binary, ternary, etc. relationships Recursive relationshipRecursive relationship Connectivity + cardinality + dependency + participation = confusionConnectivity + cardinality + dependency + participation = confusion

5 Confusion Reconciled 2 concepts: Cardinality and Participation2 concepts: Cardinality and Participation Cardinality: at most how many entity occurrences of the other entity type are associated with one occurrence of this entity type?Cardinality: at most how many entity occurrences of the other entity type are associated with one occurrence of this entity type? Participation: is every entity occurrence associated?Participation: is every entity occurrence associated?

6 Cardinality PROFESSORCOURSETEACHES 1M What is the maximum number of courses taught by a professor? Many (M).What is the maximum number of courses taught by a professor? Many (M). What is the maximum number of professors teaching a course? One (1) (fact: no team teaching at this school).What is the maximum number of professors teaching a course? One (1) (fact: no team teaching at this school).

7 Participation PROFESSORCOURSETEACHES What is the minimum number of courses taught by a professor? None ( O ).What is the minimum number of courses taught by a professor? None ( O ). What is the minimum number of professors teaching a course? One ( -- ).What is the minimum number of professors teaching a course? One ( -- ). Has every course an association (relationship)? Yes.Has every course an association (relationship)? Yes. Has every professor an association? Not necessarily.Has every professor an association? Not necessarily. A footnote: the circle should really be on the other side but this is where it is in the book (?!).

8 Cardinality and Participation Combined (better notation) PROFESSORCOURSETEACHES (0,N)(1,1) A PROFESSOR:A PROFESSOR: what is the minimum number of courses one teaches? (0)what is the minimum number of courses one teaches? (0) what is the maximum number of courses one teaches? (N)what is the maximum number of courses one teaches? (N) A COURSE:A COURSE: what is the minimum number of professors teaching it? (1)what is the minimum number of professors teaching it? (1) what is the maximum number of professors teaching it? (1)what is the maximum number of professors teaching it? (1) Format: (min, max)

9 Some special cases revisited Weak entitiesWeak entities –existence-dependent –primary key partially or totally derived from parent entity Recursive entitiesRecursive entities –entities are related to other entities of the same entity type Composite entitiesComposite entities –should relationships have properties (contain attributes)? Entity supertypes and subtypesEntity supertypes and subtypes –generalization hierarchy –inheritance –nonoverlapping (G) and overlapping (Gs) categorization

10 Generalization Hierarchy: An Example PERSON EMPLOYEESTUDENT PROFESSORADMINISTRATORUNDERGRADUATEGRADUATE Gs GsG

11 Semantic Data Modeling Practice Time!


Download ppt "Levels of Database Modeling High degree of abstraction Conceptual model User view 1 User view 2 Implementa- tion model Physical model Medium degree of."

Similar presentations


Ads by Google