7. Class Hierarchies Employees ssn name lot ISA Hourly Emps Contract Emps Hourly wage Hours worked contractid * Sometimes it’s natural to classify the entities in an entity set into subclass, then we will use Class Hierarchies.
8. Aggregation name ssn lot Employees monitors until since Sponsors Department Projects pid Started-on pbudget dname did budget * A relationship set is an association between entity sets. Sometimes we have to model a relationship between a collection of entities and relationships, then we need to use aggregation .
9.
10.
11.
12. TERNARY RELATIONSHIP Works_In Employees Department Locations Ternary relationship : is an associate of 3 entities sets . * Entity set = * Relation = ssn name lot did dname budget cap add * Attribute =
13. QUARTERY RELATIONSHIP Employees Works_In Locations Department Product Quartery relationship : is an associate of 4 entities sets. * Entity set = * Relation = * Attribute =
14.
15.
16. An example of Key Constraints on Manage Manages Department Employees ssn name lot Since dname did budget ssn = Social Security Number. did = Department id.
17.
18. Weak Entities A weak entity : is an entity of which is existence depends on other entities. Policy Department Employees ssn name lot cost Pname --------- age
19.
20.
21. Entity versus Attribute Works-In2 Department Employees ssn name lot from dname did budget to * Entity set = * Relation = * Attribute =
22. Entity versus Relationship Manages Department Employees ssn name apptnum did budget dname Mgr-Appts lot since dbudget
23. Binary versus Ternary Relationship Covers Dependents Employees ssn name Pname --------- age Policies lot policyid cost
24. Using a Ternary Relationship instead of Aggregation Sponsors Departments Projects pid Started-on did budget pbudget dname Employees name ssn lot
25. ONE TO MANY RELATIONSHIP customer customer-name customer-city customer-id borrower customer-street loan loan-number amount
26. MANY TO ONE RELATIONSHIP customer customer-name customer-city customer-id borrower customer-street loan loan-number amount
27. ONE TO ONE RELATIONSHIP customer customer-name customer-city customer-id borrower customer-street loan loan-number amount
28. E-R Diagram with Composite, Multivalued, and Derived Attributes Customer date-of-birth phone-number name customer-id first-name age last-name middle-name zip-code state city address street Street-number apartment-number street-name
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44. Example: Drinkers Have Favorite Beers name addr license name manf name addr Beers Drinkers Bars Serves Frequents Likes Favorite