Содержание
- 2. Think before doing it! Like most of the software projects, you need to think before you
- 3. AN Entity Relationship (ER) Diagram Looks Like This
- 4. ER Model Key concepts of ER model Entities Relationships Entity: Is an object that exists and
- 5. ER Model Entity Has attributes that describe it name address id
- 6. ER Model Entity set: Is the set of entities that share the same properties Samson Daniel
- 7. ER Model Entity sets may overlap Example? Employees Managers
- 8. ER Model Relationships: Relate two or more entities (such as Ali is enrolled in CS306)
- 9. ER Model Relationships: Relate two or more entities (such as Serafettin is enrolled in CS306) Relationship
- 10. ER Model Rectangles : Entity sets Ellipses : attributes student name sid
- 11. ER Model Rectangles : Entity sets Ellipses : attributes student Course name sid cid cname
- 12. ER Model Rectangles : Entity sets Diamonds : Relationship Sets Ellipses : attributes Enrolled student Course
- 13. ER Model Each entity set has attributes Each attribute has a domain (domain is the set
- 14. ER Model Each entity set has attributes Each attribute has a domain (domain is the set
- 15. ER Model Relationship sets also have attributes ER Model Enrolled student Course name sid cid cname
- 16. ER Model Relationship sets also have attributes We are going to talk about the key in
- 17. ER Model Degree of a relationship set is the number of entity sets that participate in
- 18. ER Model Ternary relationship sets involve three entity sets customer borrows loan branch
- 19. ER Model We may have relationships among the entities that belong to the same entity set
- 20. ER Model We may have relationships among the entities that belong to the same entity set
- 21. ER Model We may have relationships among the entities that belong to the same entity set
- 22. ER Model employer ename eid
- 23. ER Model employer ename eid Reports_to
- 24. ER Model employer ename eid Reports_to supervisor
- 25. ER Model employer ename eid Reports_to supervisor subordinate
- 26. ER Model Ternary relationship sets customer loan branch
- 27. ER Model Ternary relationship sets customer borrows loan branch
- 28. Mapping cardinalities 1-to-1 One-to-One relationship (ex: marriage relationship set between husbands and wives)
- 29. Mapping cardinalities 1-to-1 1-to Many One-to-One (ex: marriage relationship set between husbands and wifes) One-to-Many (example?)
- 30. Mapping cardinalities 1-to-1 1-to Many Many-to-1 One-to-One (ex: marriage relationship set between husbands and wifes) One-to-Many
- 31. Mapping cardinalities Many-to-Many 1-to-1 1-to Many Many-to-1 One-to-One (ex: marriage relationship set between husbands and wifes)
- 32. Many-to-Many 1-to-1 1-to Many Many-to-1 Consider the works_in relationship If an employee can work in multiple
- 33. Many-to-Many 1-to-1 1-to Many Many-to-1 Consider the manages relationship If an employee can manage multiple departments
- 34. Participation Constraints If every department MUST have a manager, then there is a participation constraint The
- 35. Participation Constraints If every department MUST have a manager, then there is a participation constraint The
- 36. Participation Constraints If every employee MUST work in a department, then there is a participation constraint
- 37. Participation Constraints Plus, if every department MUST have employee(s) working in that department, then there is
- 38. ISA (`is a’) Hierarchies Contract_Emps name ssn Employees lot hourly_wages Hourly_Emps contractid hours_worked
- 39. ISA (`is a’) Hierarchies Contract_Emps name ssn Employees lot hourly_wages ISA Hourly_Emps contractid hours_worked
- 40. ISA (`is a’) Hierarchies Contract_Emps name ssn Employees lot hourly_wages ISA Hourly_Emps contractid hours_worked Overlap constraints:
- 41. Weak Entities A weak entity can be identified uniquely only by considering the primary key of
- 42. Weak Entities A weak entity can be identified uniquely only by considering the primary key of
- 43. Weak Entities A weak entity can be identified uniquely only by considering the primary key of
- 44. Weak Entities A weak entity can be identified uniquely only by considering the primary key of
- 45. Weak Entities A weak entity can be identified uniquely only by considering the primary key of
- 46. Aggregation Used when we have to model a relationship involving (entitity sets and) a relationship set.
- 47. Example: Draw the ER diagram for the following specifications: There are conferences, universities, and professors. Conferences
- 48. Conceptual Design Using the ER Model Design choices: Should a concept be modeled as an entity
- 49. Entity vs. Attribute Should address be an attribute of Employees or an entity (connected to Employees
- 50. Entity vs. Attribute (Contd.) Works_In2 does not allow an employee to work in a department for
- 51. Binary vs. Ternary Relationships If each policy is owned by just 1 employee: Key constraint on
- 52. Entity vs. Relationship First ER diagram OK if a manager gets a separate discretionary budget for
- 53. Summary of Conceptual Design Conceptual design follows requirements analysis, Yields a high-level description of data to
- 54. Summary of ER (Contd.) Several kinds of integrity constraints can be expressed in the ER model:
- 55. Summary of ER (Contd.) ER design is subjective. There are often many ways to model a
- 57. Скачать презентацию