Many-to-many (M:N) RELATIONSHIP e 1 e 2 e 3 e 4 e 5 e 6 e 7 r1r2r3r4r5r6r7r1r2r3r4r5r6r7 p 1 p 2 p 3 r8r8 r9r9.

Slides:



Advertisements
Similar presentations
Database Modeling: Methods, Techniques, and Symbols
Advertisements

Conceptual Data Modeling: ER
4/15/2017 THE ENTITY–RELATIONSHIP MODEL AND EXTENSIONS (based on Ch. 3 and 4 in Fundamentals of Database Systems by Elmasri and Navathe)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 3- 1.
Copyright © 2004 Pearson Education, Inc.. Chapter 3 Data Modeling Using the Entity-Relationship 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.
4/17/2017.
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.
CS 405G Introduction to Database Systems
1  High-level conceptual model  Used for the conceptual design of DB applications  Many DB design tools employs its concepts  Chen MIT “The.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Data Modeling Using the Entity-Relationship (ER) Model CS 340: Introduction to Databases.
Topic 3 Data Modeling Using the Entity-Relationship (ER) Model
METU Department of Computer Eng Ceng 302 Introduction to DBMS Entity-Relationship (ER) Model by Pinar Senkul resources: mostly froom Elmasri, Navathe and.
1 CSBP430 – Database Systems Chapter 3: Data Modeling Using the Entity-Relationship Model Elarbi Badidi College of Information Technology United Arab Emirates.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Outline What is ER Model? And Why? Example COMPANY Database
Entity-Relationship Model. 2 Outline  What is ER Model? And Why?  Overview of Database Design Process  Example COMPANY Database  ER Model Concepts.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Data Modeling Using the Entity-Relationship (ER) Model
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Slide 3- 1 Notation for Constraints on Relationships Cardinality ratio (of a binary relationship): 1:1, 1:N, N:1, or M:N Shown by placing appropriate numbers.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe 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:
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
EER Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Conceptual Modeling and Database Design.
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.
Database Systems Background Review (2) Dr. Muhammad Shafique
Database Systems Conceptual to Relational Modeling II Lecture # 11 Feb 25 th 2011.
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.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model Copyright © 2004 Pearson Education, Inc.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 2 Modeling using the Concepts of Data Model.
Copyright © 2016 Ramez Elmasr and Shamkant B. Navathei CHAPTER 3 Data Modeling Using the Entity-Relationship (ER) Model Slide 1- 1.
Data Modeling Using the Entity-Relationship (ER) Model
Data Modeling Using the Entity-Relationship (ER) Model.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Database Design: Conceptual Modeling with ER Model CENG 351.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
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 (ER) Model
Databases (CS507) CHAPTER 7.
CS4222 Principles of Database System
Data Modeling Using the Entity- Relationship (ER) Model
Chapter 3 Data Modeling Using the Entity-Relationship Model
College of Arts & Science Computer Science Department
Data Modeling Using the Entity-Relationship (ER) Model
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
Data Modeling Using the Entity-Relationship (ER) Model
Data Modeling Using the Entity-Relationship (ER) Model
Data Modeling Using the Entity-Relationship (ER) Model
Data Modeling Using the Entity-Relationship (ER) Model
Presentation transcript:

Many-to-many (M:N) RELATIONSHIP e 1 e 2 e 3 e 4 e 5 e 6 e 7 r1r2r3r4r5r6r7r1r2r3r4r5r6r7 p 1 p 2 p 3 r8r8 r9r9

Relationships and Relationship Types (3) We can also have a recursive relationship type. Both participations are same entity type in different roles. For example, SUPERVISION relationships between EMPLOYEE (in role of supervisor or boss) and (another) EMPLOYEE (in role of subordinate or worker). In following figure, first role participation labeled with 1 and second role participation labeled with 2. In ER diagram, need to display role names to distinguish participations.

A RECURSIVE RELATIONSHIP SUPERVISION e 1 e 2 e 3 e 4 e 5 e 6 e 7 EMPLOYEE r1r2r3r4r5r6r1r2r3r4r5r6 SUPERVISION © The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition

Recursive Relationship Type is: SUPERVISION (participation role names are shown)

Attributes of Relationship types A relationship type can have attributes; for example, HoursPerWeek of WORKS_ON; its value for each relationship instance describes the number of hours per week that an EMPLOYEE works on a PROJECT.

Attribute of a Relationship Type is: Hours of WORKS_ON

Structural Constraints – one way to express semantics of relationships Structural constraints on relationships: l Cardinality ratio (of a binary relationship): 1:1, 1:N, N:1, or M:N SHOWN BY PLACING APPROPRIATE NUMBER ON THE LINK. l Participation constraint (on each participating entity type): total (called existence dependency) or partial. SHOWN BY DOUBLE LINING THE LINK NOTE: These are easy to specify for Binary Relationship Types.

Alternative (min, max) notation for relationship structural constraints: l Specified on each participation of an entity type E in a relationship type R l Specifies that each entity e in E participates in at least min and at most max relationship instances in R l Default(no constraint): min=0, max=n l Must have min  max, min  0, max  1 l Derived from the knowledge of mini-world constraints Examples: l A department has exactly one manager and an employee can manage at most one department. – Specify (0,1) for participation of EMPLOYEE in MANAGES – Specify (1,1) for participation of DEPARTMENT in MANAGES l An employee can work for exactly one department but a department can have any number of employees. – Specify (1,1) for participation of EMPLOYEE in WORKS_FOR – Specify (0,n) for participation of DEPARTMENT in WORKS_FOR

The (min,max) notation relationship constraints (1,1) (0,1) (1,N) (1,1)

COMPANY ER Schema Diagram using (min, max) notation

Relationships of Higher Degree l Relationship types of degree 2 are called binary l Relationship types of degree 3 are called ternary and of degree n are called n-ary l In general, an n-ary relationship is not equivalent to n binary relationships l Higher-order relationships discussed further in Chapter 4

Data Modeling Tools A number of popular tools that cover conceptual modeling and mapping into relational schema design. Examples: ERWin, S- Designer (Enterprise Application Suite), ER- Studio, etc. POSITIVES: serves as documentation of application requirements, easy user interface - mostly graphics editor support

Problems with Current Modeling Tools DIAGRAMMING –Poor conceptual meaningful notation. –To avoid the problem of layout algorithms and aesthetics of diagrams, they prefer boxes and lines and do nothing more than represent (primary- foreign key) relationships among resulting tables.(a few exceptions) METHODOLGY –lack of built-in methodology support. –poor tradeoff analysis or user-driven design preferences. –poor design verification and suggestions for improvement.

Some of the Currently Available Automated Database Design Tools COMPANYTOOLFUNCTIONALITY Embarcadero Technologies ER StudioDatabase Modeling in ER and IDEF1X DB ArtisanDatabase administration and space and security management OracleDeveloper 2000 and Designer 2000 Database modeling, application development Popkin SoftwareSystem Architect 2001Data modeling, object modeling, process modeling, structured analysis/design Platinum Technology Platinum Enterprice Modeling Suite: Erwin, BPWin, Paradigm Plus Data, process, and business component modeling Persistence Inc.PwertierMapping from O-O to relational model RationalRational RoseModeling in UML and application generation in C++ and JAVA Rogue WareRW MetroMapping from O-O to relational model Resolution Ltd.XcaseConceptual modeling up to code maintenance SybaseEnterprise Application Suite Data modeling, business logic modeling VisioVisio EnterpriseData modeling, design and reengineering Visual Basic and Visual C++

ER DIAGRAM FOR A BANK DATABASE © The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition

PROBLEM with ER notation THE ENTITY RELATIONSHIP MODEL IN ITS ORIGINAL FORM DID NOT SUPPORT THE SPECIALIZATION/ GENERALIZATION ABSTRACTIONS

Extended Entity-Relationship (EER) Model Incorporates Set-subset relationships Incorporates Specialization/Generalization Hierarchies NEXT CHAPTER ILLUSTRATES HOW THE ER MODEL CAN BE EXTENDED WITH - Set-subset relationships and Specialization/Generalization Hierarchies and how to display them in EER diagrams