Professional Documents
Culture Documents
Entity Relationship Concepts PDF
Entity Relationship Concepts PDF
15
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
16
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
17
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
18
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
19
reports_to
supervisor
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
20
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
21
LName
Prodname
CAddress
CUSTOMERS
PRODUCTS
orders
Quantity
offers
SUPPLIERS
SName
Price
Chain
SAddress
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
22
Many-To-Many (default)
EMPLOYEES
worksin
DEPARTMENTS
Many-To-One
EMPLOYEES
worksin
DEPARTMENTS
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
23
One-To-Many
EMPLOYEES
worksin
DEPARTMENTS
One-To-One
EMPLOYEES
worksin
DEPARTMENTS
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
24
EMPLOYEES
worksin
DEPARTMENTS
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
25
E1
(min1, max 1)
(min2 , max2)
E2
(min1, max1)
(min2, max2)
many-to-many
(0, )
(0, )
many-to-one
(0, 1)
(0, )
one-to-one
(0, 1)
(0, 1)
Relationship
UC Davis
pictorial notation
2. Entity-Relationship Model
ECS-165A WQ11
26
offers
PRODUCTS
offers
PRICE
UC Davis
PRODUCTS
Amount
2. Entity-Relationship Model
ECS-165A WQ11
27
PERSON
Name
ISA
GPA
STUDENT
Major
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
28
Specialization
Name
Address
EMPLOYEES
ISA
Hours
Wages
Contractno
HOURLY_EMPS
CONTRACT_EMPS
Price
LicensePlate
VEHICLE
ISA
NoOfPassengers
Tonage
Axels
MaxSpeed
CAR
TRUCK
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
29
Constraints on Specialization
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
30
(refined)
cardinality
ratio(s)
with
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
31
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
32
LName
CAddress
Michael
George
Kent
...
Smith
Jones
Clark
...
San Francisco
New York
Los Angeles
...
Account
10,000
2,000
-4,600
...
In SQL:
create table Customers(
FName char(40),
LName char(40),
CAddress char(70),
Account real
);
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
33
SName
Price
PC42
MacIV
...
Hal-Mart
Sears
...
2,100
2,500
...
Translation of one-many and many-one (functional) and oneone relationship types into tables can be optimized
; no table for relationship type necessary!
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
34
UC Davis
2. Entity-Relationship Model
ECS-165A WQ11
35
UC Davis
2. Entity-Relationship Model