1 Relationships Entities take part in relationships. We can often identify relationships from verbs or verb phrases. For example – you are attending this.

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

the Entity-Relationship (ER) Model
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Text-Book Chapters (7 and 8) Entity-Relationship Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Modeling Data The Entity Relationship Model (ER) For Database Design.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Information Resources Management January 30, 2001.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Entity-Relationship Diagrams
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
the Entity-Relationship Model
ICOM 5016 – Introduction to Database Systems Lecture 4 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Chapter 3: Modeling Data in the Organization
Data Modeling ERM ERD.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
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 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
1 Data Modeling : ER Model…. Lecture Summary so for …. ER Model Entity, Attribute, Key Relationships Instance Diagram.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
1 Conceptual Design 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.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
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.
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
1 CSE 480: Database Systems Lecture 3: Entity-Relationship Diagram Reference: Read Chapter 3 (5 th Edition) or 7 (6 th edition)
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 2: MODELING DATA.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
The Relational Model Lecture #2 Monday 21 st October 2001.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 17 July 28,2012 Data Modeling using the Entity Relationship.
SAN DIEGO SUPERCOMPUTER CENTER Introduction to Database Design July 2005 Ken Nunes sdsc.edu.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Entity-Relationship Model
Entity-Relationship Model
Overview of Entity‐Relationship Model
Database Modeling using Entity Relationship Model (E-R Model)
Chapter 7: Entity-Relationship Model
Presentation transcript:

1 Relationships Entities take part in relationships. We can often identify relationships from verbs or verb phrases. For example – you are attending this lecture, – I am giving the lecture. As with entities, we classify relationships according to relationship-types: – A student attends a lecture; – A lecturer gives a lecture.

2 Relationship Connectivity Constraints on the mapping of the associated entities in the relationship. Denoted by variables between the related entities. Generally, values for connectivity are expressed as “one” or “many” NameSSN EmployeeDepartment NameBudget work 1N

Types of Binary Relationship Sets Many-to-Many 1-to-11-to ManyMany-to-1

Degrees of a Relationship Man Man Woman Woman Customer Customer Order Order Course Course Subject Subject One-to-one (1:1) One-to-many (1:n) Many-to-many (n:m) NOTE: Every many to many relationship consists of two one to many relationships working in opposite directions 1M 1 1 MM

5 Connectivity DepartmentManager has 11 DepartmentProject has N1 EmployeeProject works on NM one-to-one one-to-many many-to-many

6 Simple E-R Diagram Example Student Lecture Lecturer E-R diagram example gives attend M 1 M N

7 Relationship Participation Two types  Total (representing in the ER as double lines)  Partial representing in the ER as one line) Principally we are interested in the question, “Does every entity of a some type have to take part in a relationship of a given type?” For example, it might be considered true that:  Every lecture has to be given by a lecturer (total)  Every lecturer has to give at least one lecture (total)  Every lecture has to be attended by at least one student (total)  Not every student has to attend a lecture (partial)

8 E-R Diagram We extend the relationship diagram to include participation: Student Lecture Lecturer E-R diagram extended to show relationship degrees and participations. gives attend s M 1 M N

Chapter 3-9 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

10 Recursive Relationships Employee id name address phone number Manages An entity set can participate more than once in a relationship In this case, we add a description of the role to the ER- diagram manager worker

Relationships of Higher Degree Relationship types of degree 2 are called binary Relationship types of degree 3 are called ternary and of degree n are called n-ary In general, an n-ary relationship is not equivalent to n-binary relationships

An example using a ternary relationship Each VENDOR can supply many PARTs to any number of WAREHOUSES, but need not supply any parts Each PART can be supplied by any number of VENDORs to more than one WAREHOUSE, but each part must be supplied by at least one vendor to a warehouse Each WAREHOUSE can be supplied with any number of PARTS from more than one VENDOR, but each warehouse must be supplied with at least one part

14 ER example 2 Football coach needs to collect information about his team. The coach requires information on: Players Player statistics Games Sales

15 Team Entities & Attributes Players - statistics, name, start date, end date Games - date, opponent, result Sales - date, tickets, merchandise what the Entities & Attributes ?????????????

Entities & Attributes Players Sales Start dateEnd date StatisticsName ticketsmerchandise Games opponentdateresult

17 Team Relationships Identify the relationships. The player statistics are recorded at each game so the player and game entities are related.

Team Relationships Players Games N play 1 For each game, we have multiple players so the relationship is one-to-many

19 Team Relationships Identify the relationships. The sales are generated at each game so the sales and games are related. GamesSales generates 11

Team Relationships GamesSales generates 11 We have only 1 set of sales numbers for each game, one-to- one.

21 Team ER Diagram Players Games Sales play generates N Start dateEnd dateStatistics Name ticketsmerchandise opponentdateresult

22 Useful Information Attribute or Entity-type? To decide whether a concept be modelled as an attribute or an entity-type: – Do we wish to store any information about this concept (other than an identifying name)? – Is it single-valued?

23 Determining components of an E-R Diagram From a description of the Universe of Discourse (UoD): Underline nouns and noun-phrases – These are candidates for entity-types Underline verbs and verb-phrases – These are candidates for relationship-types Check each entity- and relationship-type for relevance. Remove any for which there is only one instance.