Keys for Relationship Sets The combination of primary keys of the participating entity sets forms a super key of a relationship set. – (customer-id, account-number)

Slides:



Advertisements
Similar presentations
Chapter 2: Entity-Relationship Model
Advertisements

Temple University – CIS Dept. CIS616– Principles of Database Systems
Chapter 2: Entity-Relationship Model
Text-Book Chapters (7 and 8) Entity-Relationship Model
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Entity-Relationship Model Lecture 2. Database Modeling and Implementation Process Ideas ER DesignRelational Schema Relational DBMS Implementation.
1 Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an E-R Database.
Chapter 2: Entity-Relationship Model (Continued)
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Entity-Relationship Model
Enhanced Entity-Relationship Model (EER) 1. Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses,
Notes by Ankur Shukla Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys.
Entities and Attributes
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Entity-Relationship Model
Chapter 2: Database Design and Entity-Relationship Model  Database Design  Entity Sets  Relationship Sets  Design Issues  Mapping Constraints  Keys.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Chapter 6: Entity-Relationship Model. Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the.
6.1 Chapter 6: Database Design and the ER Model Skip 6.5.3, 6.10, 6.11.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan Chapter 6: Entity-Relationship Model.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts DB Schema Design: the Entity-Relationship Model What’s the use of the E-R model? Entity Sets.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model ([S] Chp. 6) Entity Sets Relationship Sets Design Issues.
Entity Relationship Diagram (2)
DATABASE MANAGEMENT SYSTEM Entity-Relationship Model.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database and Information Retrieval System
 Design Process  Modeling  Constraints  E-R Diagram  Design Issues  Weak Entity Sets  Extended E-R Features  Design of the Bank Database  Reduction.
Database System Concepts, 5th Ed. Bin Mu at Tongji University Chapter 6: Entity-Relationship Model.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Ramez Elmasri and Shamkant Navathe Enhanced-ER (EER) Model Concepts.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Chapter 6: Entity-Relationship Model. Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the.
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CS157A Lecture 4 ER Model 2 Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Extended ER Modelling. Extended E-R Features: Specialization Top-down design process; we designate subgroupings within an entity set that are distinctive.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module 8: Entity-Relationship.
CS3431-B111 The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Chapter 4_part2: The Enhanced Entity-Relationship (EER) Model.
Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an.
Database System Concepts ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 6: Entity-Relationship.
Chapter 2: Entity-Relationship Model
Entity Relationship (E-R) Model
Chapter 2: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Database EER.
Chapter 6: Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Module 8 – Database Design Using the E-R Model
CS4222 Principles of Database System
Chapter 6: Entity-Relationship Model
Database EER.
Chapter 2: Entity-Relationship Model
Chapter 6b: Database Design Using the E-R Model
Presentation transcript:

Keys for Relationship Sets The combination of primary keys of the participating entity sets forms a super key of a relationship set. – (customer-id, account-number) is the super key of depositor Must consider the mapping cardinality of the relationship set when deciding the what are the candidate keys Need to consider semantics of relationship set in selecting the primary key in case of more than one candidate key 1

E-R Diagram with a Ternary Relationship 2

Design Issues Use of entity sets vs. attributes Choice mainly depends on the structure of the enterprise being modeled, and on the semantics associated with the attribute in question. Use of entity sets vs. relationship sets Possible guideline is to designate a relationship set to describe an action that occurs between entities Binary versus n-ary relationship sets Although it is possible to replace any nonbinary (n-ary, for n > 2) relationship set by a number of distinct binary relationship sets, a n- ary relationship set shows more clearly that several entities participate in a single relationship. Placement of relationship attributes 3

Enhanced-ER (EER) Model Concepts Includes all modeling concepts of basic ER Additional concepts: subclasses/superclasses, specialization/generalization, categories, attribute inheritance The resulting model is called the enhanced-ER or Extended ER (E2R or EER) model It is used to model applications more completely and accurately if needed

Specialization Top-down design process; we designate subgroupings within an entity set that are distinctive from other entities in the set. These subgroupings become lower-level entity sets that have attributes or participate in relationships that do not apply to the higher-level entity set. Depicted by a triangle component labeled ISA (E.g. customer “is a” person). Attribute inheritance – a lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked. 5

Specialization Example 6

Generalization A bottom-up design process – combine a number of entity sets that share the same features into a higher- level entity set. Specialization and generalization are simple inversions of each other; they are represented in an E-R diagram in the same way. The terms specialization and generalization are used interchangeably. 7

Specialization and Generalization (Contd.) Can have multiple specializations of an entity set based on different features. E.g. permanent-employee vs. temporary-employee, in addition to officer vs. secretary vs. teller Each particular employee would be – a member of one of permanent-employee or temporary- employee, – and also a member of one of officer, secretary, or teller The ISA relationship also referred to as superclass - subclass relationship 8

Inheritance STAFF SALES PERSONNEL Unshared Attributes Superclass Address DobName Sales Area Car Allowance Shared Attributes Subclass REQUIRE CAR Unshared Relationship CONTRACT COMPANY Shared Relationship

Disjointness Constraint: – Specifies that the subclasses of the specialization must be disjointed (an entity can be a member of at most one of the subclasses of the specialization). Specified by d (inside the circle) in EER diagram – If not disjointed, overlap; that is the same entity may be a member of more than one subclass of the specialization. Specified by o (inside the circle) in EER diagram Constraints on Specialization and Generalization (1)

Introduction to Databases11 Completeness Constraint: – Total specifies that every entity in the superclass must be a member of some subclass in the specialization/ generalization. Shown in EER diagrams by a double line – Partial allows an entity not to belong to any of the subclasses. Shown in EER diagrams by a single line Constraints on Specialization and Generalization (2)

Constraints on Specialization and Generalization (3) Hence, we have four types of specialization/generalization: – Disjoint, total – Disjoint, partial – Overlapping, total – Overlapping, partial Note: Generalization usually is total because the superclass is derived from the subclasses.

Example of disjoint partial Specialization

Example of overlapping total Specialization

Aggregation n Consider the ternary relationship works-on, which we saw earlier n Suppose we want to record managers for tasks performed by an employee at a branch 15

Aggregation (Cont.) Relationship sets works-on and manages represent overlapping information – Every manages relationship corresponds to a works-on relationship – However, some works-on relationships may not correspond to any manages relationships So we can’t discard the works-on relationship Eliminate this redundancy via aggregation – Treat relationship as an abstract entity – Allows relationships between relationships – Abstraction of relationship into new entity 16

E-R Diagram With Aggregation Without introducing redundancy, the following diagram represents: An employee works on a particular job at a particular branch An employee, branch, job combination may have an associated manager 17

E-R Design Decisions The use of an attribute or entity set to represent an object. Whether a real-world concept is best expressed by an entity set or a relationship set. The use of a ternary relationship versus a pair of binary relationships. The use of specialization/generalization – contributes to modularity in the design. The use of aggregation – can treat the aggregate entity set as a single unit without concern for the details of its internal structure. 18

Case Study: Requirements for the part of the UNIVERSITY database The database Keeps track of three types of people: employees, alumni, and students, A person can belong to one, two, or all three of these types. Each person has a name, SSN, sex, address, and birth date. Every employee has a salary, and there are three types of employees: faculty, staff, and student assistants. Each employee belongs to exactly one of these types. For each alumnus, a record of the degree or degrees that he or she earned at the university is kept. Including the name of the degree, the year granted, and the major department. Each student has a major department. Each faculty has a rank, whereas each staff member has a staff position. Student assistants are classified further as either research assistants of teaching assistants, and the percent of time that they work is recorded in the database. Research assistants have their research project stored, whereas teaching assistants have the current course they work on. Students are further classified as either graduate or undergraduate, with the specific attributes degree program (M.S.,PH.D) and class (freshman, sophomore, and so on), respectively.

Specialization / Generalization Lattice Example (UNIVERSITY)