--The Entity Relationship Model(2)--1 Reflexive Rela1tionships  An entity may be related to another entity of the same type.  Example: A Customer could.

Slides:



Advertisements
Similar presentations
Chapter 2: Entity-Relationship Model
Advertisements

Chapter 6: Entity-Relationship Model (part I)
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
The Entity-Relationship Model
--The Entity Relationship Model(3)--1 Outline  ER model  Overview  Entity types Attributes, keys  Relationship types  Weak entity types  Uses Crows.
Text-Book Chapters (7 and 8) Entity-Relationship Model
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Databases Revision.
--The Entity Relationship Model(1)--1 The Entity Relationship Model.
Modeling Data The Entity Relationship Model (ER) For Database Design.
Mapping the ER Model to Relations(1)1 Overview  Mapping entity types  Mapping relationship types  One-to-one  One-to-many  Many-to-many.
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.
The Entity-Relationship Data Model
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
--The Entity Relationship Model(4)--1 Outline  ER model  Overview  Entity types Attributes, keys  Relationship types  Weak entity types  uses Integration.
Introduction to Database Review 1. What is a database  Basic Definitions  Database Management System (DBMS): A software package to facilitate the process.
Chapter 2: Entity-Relationship Model (Continued)
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
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
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 2: Representing Information with Data Models The lecture notes.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
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.
6.1 Chapter 6: Database Design and the ER Model Skip 6.5.3, 6.10, 6.11.
©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.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
CS 370 Database Systems Lecture 9 The Relational 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:
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
Entity Relationship Diagram (2)
09/03/2009Lipyeow Lim -- University of Hawaii at Manoa 1 ICS 321 Fall 2009 Introduction to Database Design Asst. Prof. Lipyeow Lim Information & Computer.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Weak Entity Sets A weak entity is an entity that cannot exist in a database unless another type of entity also exists in that database. Weak entity meets.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
Data Modeling Using the Entity-Relationship (ER) Data Model.
1 Announcements Reading for next week: Chapters 8 and 10  Last reading from the text for a little while (I promise) About those database accounts....
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.
©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.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Chapter 14 Semantic Modeling. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.14-2 Topics in this Chapter The Overall Approach The E/R Model.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
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.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Modeling: Entity-Relationship Diagrams
A short review on entity- relationship modelling.
Entity Relationship Model
Entity-Relationship Model
INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett,
Chapter 6: Entity-Relationship Model
Entity Relation Model Tingting Zhang.
Presentation transcript:

--The Entity Relationship Model(2)--1 Reflexive Rela1tionships  An entity may be related to another entity of the same type.  Example: A Customer could have Children, who are also Customers. Joe Doe is Jane Doe’s father. Bob Doe is Jane Doe’s son. Customer Joe Doe Bob Doe Jane Doe Sue San Child

--The Entity Relationship Model(2)--2 Reflexive Relationship Types - Diagram  Relationship type connects to self in an ER diagram. Children Customer

--The Entity Relationship Model(2)--3 Kinds of Relationship Types  How many of each entity type participate in a relationship type?  1-1  1-many  many-1  many-many  Total vs. Partial participation  Total participation means that every entity participates in the relationship.  Partial means that some entities might not participate.  Bounds (min-max) on participation  (At least) three different “diamond” notations  Arrow vs. straight line with or without participation bounds  DO NOT MIX NOTATIONS!

--The Entity Relationship Model(2)--4 An Example One-to-One Relationship Type  A Customer might be an Employee.  An Employee IsA Customer.  Participation is total on the Employee side in this example. CustomerIsAEmployee

--The Entity Relationship Model(2)--5 Diagramming One-To-One Rel. Types  An element in A is associated with at most one element in C via the relationship B. An element in C is associated with at most one element in A via B. A B C A B C A B C 11 (0,1)

--The Entity Relationship Model(2)--6 DVD Store Database Example  An employee can also be a customer.  Each Customer entity can be matched with at most one Employee entity, and each Employee entity can be matched with at most one Customer entity (both entities represent the same person).  Often this can be better represented using additional attributes, or by using subclasses (wait a few slides!) Employee IsA Customer 11

--The Entity Relationship Model(2)--7 Total vs. Partial Participation  Use a double line to indicate total participation.  Example: Every A is in a B relationship with exactly one C, but some C’s may be unrelated to an A.  Using participation constraints, total participation is a 1 on the minimum bound. A B C 11 A B C (1,1)(0,1)

--The Entity Relationship Model(2)--8 An Example One-to-Many Relationship Type  A Customer Rents zero to several DVD copies.  A DVD copy can be Rented by at most one Customer.  Participation is partial on both sides in this example. CustomerRentsDVD copy

--The Entity Relationship Model(2)--9 One-To-Many Relationship  An element in A is associated with several (including 0) elements in C via B. An element in C is associated with at most one element in A via B. A B C A B C A B C 1m (0,m)(0,1)

--The Entity Relationship Model(2)--10 DVD Store Database Example  A Customer might not be related to a DVD copy entity.  Each DVD copy entity is associated with at most one Customer entity. Customer Rents DVD copy 1m

--The Entity Relationship Model(2)--11 An Example Many-to-Many Rel. Type  A Performer Stars In one or many Films.  A Film can Star zero to many Performers.  Participation is total on the Performer in this example. PerformerStars InFilm

--The Entity Relationship Model(2)--12 Many-To-Many Relationship  An element in A is associated with several elements in C via B.  An element in C is associated with several elements in A via B. A B C A B C A B C nm (0,m)(0,n)

--The Entity Relationship Model(2)--13 DVD Store Database Example PerformerFilm mn Stars In NameFilmID Role

--The Entity Relationship Model(2)--14 Roles  Definition: A role is a label on a relationship type edge.  Example: labels "parent" and "child" are roles.  Roles are optional, and are used to clarify semantics of a relationship type. Children Customer (0,20) parent (0,2) child

--The Entity Relationship Model(2)--15 Weak Entity Types  Definition: A weak entity type borrows key attributes from another entity type (called the owning or strong entity type) to uniquely identify entities.  Example: A DVD copy has a Copy #, relative to a Film title (e.g., `Babe copy 1’, `Babe copy 2’, `Finding Nemo copy 1’. Copy # is not a key, but combined with Title it is (for DVD copy).  ER diagram - double box represents weak entity type.  The existence of a DVD copy entity depends on the existence of a Film entity. FilmDVD copy 1m Copies Status Copy # Title

--The Entity Relationship Model(2)--16 Weak Entity Type – Partial Keys  A weak entity type has a partial key (key is completed by borrowing key attributes from owning entity type(s)).  Example: Key for Video Tape is (Title, Copy#).  ER diagram - partial key represented with dashed line. FilmDVD copy 1m Copies Status Copy # Title

--The Entity Relationship Model(2)--17 Weak Entity Type, cont.  Semantics:  Deletion of a Film entity requires deletion of that film's DVD copy entities.  A weak entity is related to precisely one entity in the owning entity type, via a 1-1 or 1-many relationship.  It is possible to introduce more attributes to the DVD copy entity type, so that a primary key will exist, but they may not be needed for database processing.

18 Cascaded Weak Entity Types  Weak entity types can be cascaded:  Semantics:  To delete an employee, the family's dependents and their medical records must also be deleted. EmployeeDependent 1m emp fam Dependent Name Gender PhoneName SSN Fam med Medical Record Visit Num Date 1 m

A Video Store ER Schema Customer Rents DVD Status Film Copies Performer StarsIn Children Reserves NumCheckOuts AmountPaid ReturnDate Status Title Address Street City State CustomerIDTotalRes Name Role Name FilmID RentalPrice Distributor Kind Date Director parent (0,n) child (0,2) 1m m 1 n nm m CopyNum