











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z Example Database Application (COMPANY)
z ER Model Concepts
z ER Diagrams - Notation
z ER Diagram for COMPANY Schema
z Alternative Notations – UML class diagrams, others
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Example COMPANY
Database
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z Simple
z Composite
z Multi-valued
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z In general, composite and multi-valued attributes may be
nested arbitrarily to any number of levels although this is rare. For example, PreviousDegrees of a STUDENT is a composite multi-valued attribute denoted by {PreviousDegrees (College, Year, Degree, Field)}.
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z Entities with the same basic attributes are grouped or typed into an entity type. For example, the EMPLOYEE entity type or the PROJECT entity type. z An attribute of an entity type for which each entity must have a unique value is called a key attribute of the entity type. For example, SSN of EMPLOYEE. z A key attribute may be composite. For example, VehicleTagNumber is a key of the CAR entity type with components (Number, State). z An entity type may have more than one key. For example, the CAR entity type may have two keys:
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
ENTITY SET corresponding to the
ENTITY TYPE CAR
car 1 ((ABC 123, TEXAS), TK629, Ford Mustang, convertible, 1999, (red, black)) car (^2) ((ABC 123, NEW YORK), WP9872, Nissan 300ZX, 2-door, 2002, (blue)) car (^3) ((VSY 720, TEXAS), TD729, Buick LeSabre, 4-door, 2003, (white, blue))
CAR Registration(RegistrationNumber, State), VehicleID, Make, Model, Year, (Color)
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z A relationship relates two or more distinct entities with a specific meaning. For example, EMPLOYEE John Smith works on the ProductX PROJECT or EMPLOYEE Franklin Wong manages the Research DEPARTMENT. z Relationships of the same type are grouped or typed into a relationship type. For example, the WORKS_ON relationship type in which EMPLOYEEs and PROJECTs participate, or the MANAGES relationship type in which EMPLOYEEs and DEPARTMENTs participate. z The degree of a relationship type is the number of participating entity types. Both MANAGES and WORKS_ON are binary relationships.
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Example relationship instances of the WORKS_FOR relationship between EMPLOYEE and DEPARTMENT
e 1 z e 2 z
e 3 z e 4 z e 5 z e 6 z e 7 z
r (^1)
r (^2)
r (^3)
r (^4)
r (^5)
r (^6)
r (^7)
z d^1
z d^2
z d^3
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Example relationship instances of the WORKS_ON relationship between EMPLOYEE and PROJECT
e 1 z e 2 z e 3 z e 4 z
e 5 z e 6 z e 7 z
r (^1)
r (^2)
r (^3)
r (^4)
r (^5)
r (^6)
r (^7)
z p^1
z p^2
z p^3
r (^8)
r (^9)
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
z More than one relationship type can exist with the same
participating entity types. For example, MANAGES and WORKS_FOR are distinct relationships between EMPLOYEE and DEPARTMENT, but with different meanings and different relationship instances.
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Constraints on Relationships
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Many-to-one (N:1) RELATIONSHIP
e 1 z e 2 z
e 3 z e 4 z e 5 z e 6 z
e 7 z
r (^1)
r (^2)
r (^3)
r (^4)
r (^5)
r (^6)
r (^7)
z d^1
z d^2
z d^3
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
e 1 z e 2 z e 3 z e 4 z
e 5 z e 6 z e 7 z
r (^1)
r (^2)
r (^3)
r (^4)
r (^5)
r (^6)
r (^7)
z p^1
z p^2
z p^3
r (^8)
r (^9)
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Attributes of Relationship types
zA 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.
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Structural constraints on relationships:
z Cardinality ratio (of a binary relationship): 1:1, 1:N, N:1, or M:N SHOWN BY PLACING APPROPRIATE NUMBER ON THE LINK.
z 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.
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Relationships of Higher Degree
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Data Modeling Tools
POSITIVES: serves as documentation of
application requirements, easy user interface - mostly graphics editor support
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Problems with Current
Modeling Tools
Chapter 3- Copyright © 2004 Pearson Education, Inc.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
PROBLEM with ER notation
THE ENTITY RELATIONSHIP MODEL IN ITS ORIGINAL FORM DID NOT SUPPORT THE SPECIALIZATION/ GENERALIZATION ABSTRACTIONS
Chapter 3- Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Extended Entity-Relationship
(EER) Model