Database Management COP4540, SCS, FIU Database Modeling Using the Entity- Relationship Model (Continued)

Slides:



Advertisements
Similar presentations
the Entity-Relationship (ER) Model
Advertisements

Constraints in Entity-Relationship Models Zaki Malik September 18, 2008.
Conceptual Data Modeling: ER
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
Database Systems ER and EER to Relational Mapping Toqir Ahmad Rana Database Management Systems 1 Lecture 18.
CS 405G Introduction to Database Systems
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
Transforming ER & EER diagrams into Relations (Chapter 9)
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
CONCEPTS OF E-R MODEL. CONTENTS Entity Attributes Data Value Entity Types Types of Entity Types Relationships Relationship Constraints.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Outline What is ER Model? And Why? Example COMPANY Database
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship
1 E/R to relational mapping algorithm – overview Mapping algorithm step 1-7 Steen Jensen, autumn 2013.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Continued)
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Conceptual Modeling and Database Design.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 3- 1.
Database Systems – ER Diagrams EXAMPLE COMPANY DATABASE Requirements of the Company (oversimplified to illustrate) The company is organized into DEPARTMENTs.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 9 Relational Database Design by ER- and EERR-to-Relational Mapping Slide 9- 1.
1 CSE 480: Database Systems Lecture 3: Entity-Relationship Diagram Reference: Read Chapter 3 (5 th Edition) or 7 (6 th edition)
Conceptual Modelling The Entity-Relationship (ER) Model The ER diagram Data Modelling.
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
Data Modeling Using the Entity- Relationship (ER) Model
Comp 1100 Entity-Relationship (ER) Model
Databases (CS507) CHAPTER 7.
Chapter 3 Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity- Relationship (ER) Model
Database Management Systems
ER model Ashima Wadhwa.
Entity Relationship Model
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Constraints in Entity-Relationship Models
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
Database Systems Instructor Name: Lecture-9.
Database Modeling using Entity Relationship Model (E-R Model)
Conceptual Data Modeling Using Entities & Relationships
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

Database Management COP4540, SCS, FIU Database Modeling Using the Entity- Relationship Model (Continued)

Database Management COP4540, SCS, FIU Usage of Weak Entities Weak Entity can be used when converting a n-ary relationship to a number of binary relationships. The basic algorithm can be found in the previous lecture note. The additional ENTITY CLASS is actually a weak entity.

Database Management COP4540, SCS, FIU An Example of Ternary Relationship SUPPLIERPROJECT PART SName ProjNamePartNo SUPPLY Quantity

Database Management COP4540, SCS, FIU Converted E-R Diagram SUPPLIERPROJECT PART SName ProjNamePartNo Quantity SUPPLY SSSPJSP 1 N 1N 1 N

Database Management COP4540, SCS, FIU What if defining a cardinality constraint SUPPLIERPROJECT PART SName ProjNamePartNo SUPPLY Quantity 1M N

Database Management COP4540, SCS, FIU Converted E-R Diagram SUPPLIERPROJECT PART SName ProjNamePartNo Quantity SUPPLY SS SPJSP 11 1N 1 N

Database Management COP4540, SCS, FIU Design Principles Faithfulness Avoiding redundancy Keep it simple Picking the right kind of element

Database Management COP4540, SCS, FIU Faithfulness Include everything needs to be described. Avoid meaningless descriptions. Enforce as many constraints as possible. –Cardinality Ratios. –Participation Constraints –Existence Dependency.

Database Management COP4540, SCS, FIU Cardinality Ratios The cardinality ratios for binary relationships –1:1, 1:N, N:1, and M:N Attributes of 1:1 relationship types can be migrated to either of the participating entity types. Attributes of 1:N or N:1 relationship types can be migrated only to the entity type at N-side of the relationship. Attributes of M:N relationship types must be specified as relationship attributes.

Database Management COP4540, SCS, FIU Examples EMPLOYEE Manages 11 Starting date DEPARTMENT EMPLOYEE Manages 11 Starting date DEPARTMENT EMPLOYEE Manages 11 Starting date DEPARTMENT

Database Management COP4540, SCS, FIU Examples PROJECTEMPLOYEE Works_on 1 N Hours PROJECTEMPLOYEE Works_on 1 N Hours Note: IF we assumed that each employee can only work on one project, and there may be many employees working on the same project, THEN: The attribute Hours can be migrated to EMPLOYEE, but not PROJECT.

Database Management COP4540, SCS, FIU Examples EMPLOYEE Works_on M N PROJECT Hours Note: IF we assume that each employee may work on multiple projects at the same time, and there may be many employees working on the same projects, THEN: The attribute Hours can not be migrated to either PROJECT or EMPLOYEE.

Database Management COP4540, SCS, FIU Participation Constraints It specifies whether the existence of an entity depends on its being related to another entity via relationship type. Two types –total participation (Using double line connecting the participating entity type) –partial participation Total participation is also called Existence Dependency.

Database Management COP4540, SCS, FIU Examples DEPARTMENT EMPLOYEE Works_for 1N Note: IF we assume that every employee should be assigned to certain department. THEN: There is a total participation constraint defined on EMPLOYEE via the relationship Works_for.

Database Management COP4540, SCS, FIU Examples DEPARTMENT EMPLOYEE Works_for 1N Note: IF we assume that each department should have at least one employee being assigned, THEN: There is a total participation constraint defined on DEPARTMENT via the relationship Works_for.

Database Management COP4540, SCS, FIU Examples DEPARTMENT EMPLOYEE Manages 11 Note: IF we assume that should have exactly one manager, but not every employee could be a manager of certain department, THEN: There is a total participation constraint defined on DEPARTMENT via the relationship type Manages. However, EMPLOYEE partially participates the relationship type Manages.

Database Management COP4540, SCS, FIU Alternative Notations for Constraints A pair of integer (min, max) with each participation of entity type E in a relationship type R. ( max min  0, max  1) min: at least min; max: at most max min = 0 implies partial participation. min  1 implies total participation.

Database Management COP4540, SCS, FIU Examples DEPARTMENT EMPLOYEE Works_for (4,N) (1,1) This example implies that each employee is assigned to one and only one department. Each department has at least four employees, and there is no upper limit of the number of employees in a department. DEPARTMENT EMPLOYEE Works_for 1 N

Database Management COP4540, SCS, FIU Examples DEPARTMENT EMPLOYEE Manages (0,1)(1,1) What does this example imply? DEPARTMENT EMPLOYEE Manages 11 What does this example imply?

Database Management COP4540, SCS, FIU Examples DEPENDENT namesex birthdate relationship EMPLOYEE Dependents_of (0,N) (1,1) SSN What does this example imply?

Database Management COP4540, SCS, FIU Avoiding Redundancy Problem with redundancy –Wastes space. –Encourages inconsistency. Principle: describe and store everything once only. Intuition: something is redundant if it could be hidden from view, and you could still figure out what it is from the other data.

Database Management COP4540, SCS, FIU Examples BEERSMANFS ManfBy name address BEERS name manf manfadd Question: Which one is better?

Database Management COP4540, SCS, FIU KISS: Keep It Simple, Student Avoid intermediate concepts if unnecessary. BEERSMANFS ManfBy name