Database Design Example : ORDER SYSTEM CUSTOMER 1:1 PLACES 0:M ORDER 1:M ORDERLINE 1:M CONTAINS 1:M PRODUCT Customers cFirstName cLastName Primary Key 1:1 cPhone 0:M Foreign Key cFirstName cLastName cPhone Primary Key cStreet cZipCode orderDate soldBy Orders.

Download Report

Transcript Database Design Example : ORDER SYSTEM CUSTOMER 1:1 PLACES 0:M ORDER 1:M ORDERLINE 1:M CONTAINS 1:M PRODUCT Customers cFirstName cLastName Primary Key 1:1 cPhone 0:M Foreign Key cFirstName cLastName cPhone Primary Key cStreet cZipCode orderDate soldBy Orders.

Database Design Example : ORDER SYSTEM
CUSTOMER
1:1
PLACES
0:M
ORDER
1:M
ORDERLINE
1:M
CONTAINS
1:M
PRODUCT
Customers
cFirstName
cLastName
Primary Key
1:1
cPhone
0:M
Foreign Key
cFirstName cLastName
cPhone
Primary Key
cStreet
cZipCode
orderDate
soldBy
Orders
Customers
custID cFirstName cLastName cPhone
PK
Candidate Key (1 of 2)
1:1
Orders 0:M
FK
custID orderDate
Primary Key
soldBy
cStreet
cZipCode
Customers
custID cFirstName cLastName cPhone
cStreet
cZipCode
PK
Candidate Key (1 of 2)
1:1
Orders 0:M
FK
custID orderDate
soldBy
Primary Key
1:1
OrderLines
1:M
Foreign Key
custID orderDate
UPC
quantity
unitSalePrice
Primary Key
FK
Products 1:1
0:M
PK
UPC prodName
mfgr
model unitListPrice
unitsInStock
Candidate Key (1 of 2)
Table (relation) name Customers
cStreet
Column (attribute) names cFirstName cLastName cPhone
Tom
Jewett
714-555-1212 1020 Slater
Row (tuples)
cZipCode
92708
Alvaro
Monge
562-333-4141 2145 Main
90840
Wayne
Dick
562-777-3030 1250 Bellfower
90840
Table (relation) name Orders
orderDate
Column (attribute) names cFirstName cLastName cPhone
Alvaro
Monge
562-333-4141 2003-07-14
Row (tuples)
soldBy
Patrick
Wayne
Dick
562-777-3030 2003-07-14
Patrick
Alvaro
Monge
562-333-4141 2003-07-18
Kathleen
Customers
custId cFirstName cLastName
cPhone
cStreet
cZipCode
1234
Tom
Jewett
714-555-1212 1020 Slater
92708
5678
Alvaro
Monge
562-333-4141 2145 Main
90840
9012
Wayne
Dick
562-777-3030 1250 Bellfower
90840
Orders
custId
orderDate
soldBy
5678
2003-07-14
Patrick
9012
2003-07-14
Patrick
5678
2003-07-18
Kathleen
OrderLines
Orders
custID orderDate
UPC
Products
custID orderDate
5678
2003-07-14
51820 33622
UPC
5678
2003-07-14
9012
2003-07-14
51820 33622
51820 33622
9012
2003-07-14
9012
2003-07-14
11373 24793
42877 34040
5678
2003-07-18
5678
2003-07-18
81809 73555
81809 73555
5678
2003-07-20
5678
2003-07-20
51820 33622
11373 24793
5678
2003-07-20
81809 73555
81810 63591
5678
2003-07-20
81810 63591