Database Chapter02-02
Database Chapter02-02
Database Application
SAK 3408
CHAPTER 2
DATABASE DESIGN
Relation
3
Requirements:
CustID
Date
Items
4/11/02
23
6/11/02
1 Scissor
15
7/11/02
2 Pen, 2 Notebook
7/11/02
23
7/11/02
1 Stapler
8/11/02
Is this a relation?
5
OrderID
CustID
Date
Quantity
Items
4/11/02
Pencils
4/11/02
Erasers
4/11/02
Rulers
23
6/11/02
Scissor
15
7/11/02
Pen
15
7/11/02
Notebook
7/11/02
15
23
7/11/02
Stapler
8/11/02
Example
6
DEPT_NO
MANAGER_NO
EMP_NO
EMP_NAME
D101
12345
20000
20001
20002
Carl Sagan
Magic Johnson
Larry Bird
D102
13456
30000
30001
Jimmy Carter
Paul Simon
Dept_N
o
Manager_N
o
Emp_N
o
Emp_Name
D101
12345
2000
Carl Sagan
D101
12345
2001
Magic Johnson
D101
12345
2002
Larry Bird
D102
13456
3000
Jimmy Carter
D102
13456
30001
Paul Simon
Key
9
2.
3.
(a)
Foreign key
Foreign key
Foreign key
Foreign key
Not Assigned
Default
Identifier
It
Assigned
same relation
Many-to-Many - Two relations:
One
(b) EMPLOYEE
relation with
recursive foreign
key
29
(a) Bill-of-materials
relationships (M:N)
(a)
35
Exercise (1)
36
phone
Exercise (2)
37
Exercise (3)
38
Exercise (4)
39
Exercise (5)
40
Exercise (6)
41
Name
Graphics
Sound
Name
Phone no
Rater
Game
rates
by
Developer
Name
Ability
Gameplay
Platform
Exercise (7)
42