Professional Documents
Culture Documents
Database Design: INFO2040 Distributed Computing Technologies Topics
Database Design: INFO2040 Distributed Computing Technologies Topics
Topics
Revision
ER Diagrams
Relational Model
Normalisation
Database Design
Database Design
Slide 1
Database Design
Slide 2
Database Design
Entities
Entities have properties or characteristics
called attributes
An entity occurrence is a particular instance
of an entity
An entity occurrence will have a set of
attributes which distinguish it from all other
instances of the same entity
Database Design
Slide 4
Attributes
Street
Attributes
Address
Composite
City
State
Simple
DOB
Phone
No
Attributes may be
Null
Pass
port
Multi-valued
Age
Derived
Person
Database Design
Slide 5
Identifiers
Relationships
Fred
AGF-45H
Fred AGF-45H
Mary MS-587
Database Design
Slide 7
MS-587
Sue
Database Design
Slide 8
Sue ABC-123
INFO204 Distributed Computing Technologies. Martin Sutton
Cardinality of Relationships
Person
Person
Person
Person
Relationship
Slide 9
Upper Bound
Lower Bound
Lower Bound
Database Design
Slide 11
Car
Car
drives
Car
drives
Car
Participation Constraints
Course
drives
Entity
Person
Database Design
drives
Car
drives
Entity
Upper Bound
1:4
Enrol
0:N
Student
Slide 12
Relations
Relations
table
row
column
Database Design
Slide 13
Relation Name
Relation
Key
Tuples
Slide 14
Attributes
Properties of Relations
Parts
PartNo Name Colour Weight Length
P1
Snorg
black
15
P7
Flimpet brown
36
124
P3
Gleftor
11
grey
Domains
PartNo
Name
Colour
Weight
Length
Database Design
alpha
string
( black, brown, grey )
numeric
numeric
Slide 16
Relation Keys
Database Design
Database Design
Slide 17
Slide 18
Facts
Facts
Slide 19
Slide 20
Facts
Slide 21
Dependency Diagrams
PersonID DOB
Slide 23
Database Design
Slide 22
determinant attribute
Determinant Attribute
Database Design
PersonID DOB
but can also see that
PersonID, Name DOB
the first example is a Full Functional Dependency
since the DOB is fully dependent on the PersonID
the second example is not a full functional
dependency since we do not need to know Name
in order to determine the DOB
Determnt Atrtribute
we know that
DOB
Database Design
Slide 24
Normal Forms
Slide 25
Database Design
Slide 27
Com pany
XYZ
XYZ
XYZ
Acm e
Acm e
Acm e
A lp h a
A lp h a
A lp h a
It e m
G r o o z le
C h im e r a
F lu d g e r
F lu d g e r
G r o o z le
S c rim p o t
G r o o z le
S c rim p o t
C h im e r a
Slide 26
Database Design
Q ty
5
3
7
78
4
15
8
1
1
Slide 28
Slide 29
OrderID
Database Design
C o m p a n y
X Y Z
X Y Z
X Y Z
A c m e
A c m e
A c m e
A lp h a
A lp h a
A lp h a
Company
Slide 31
Ite m
G r o o z le
C h im e r a
F lu d g e r
F lu d g e r
G r o o z le
S c r im p o t
G r o o z le
S c r im p o t
C h im e r a
Item
Q ty
5
3
7
7 8
4
1 5
8
1
1
Qty
Com pany
XYZ
XYZ
XYZ
Acm e
Acm e
Acm e
A lp h a
A lp h a
A lp h a
Ite m
G r o o z le
C h im e r a
F lu d g e r
F lu d g e r
G r o o z le
S c r im p o t
G r o o z le
S c r im p o t
C h im e r a
Slide 30
Q ty
5
3
7
78
4
15
8
1
1
D is c
0
0
0
20
0
10
0
0
0
O rderID
O 21
O3
O7
OrderID
C om pany
X YZ
A cm e
A lpha
Company
Disc
OrderID
Database Design
Slide 32
O r d e r ID
O 2 1
O 2 1
O 2 1
O 3
O 3
O 3
O 7
O 7
O 7
Item
Ite m
G r o o z le
C h im e r a
F lu d g e r
F lu d g e r
G r o o z le
S c r im p o t
G r o o z le
S c r im p o t
C h im e r a
Qty
Q ty
5
3
7
7 8
4
1 5
8
1
1
D is c
0
0
0
2 0
0
1 0
0
0
0
Disc
Database Design
P N am e
R oller
R oller
R oller
W histle
W histle
B igBoy
B igBoy
B igBoy
W olf
E m pID
E101
E102
E104
E103
E101
E103
E104
E102
E101
EN am e
M ary
John
Sue
B ill
M ary
B ill
Sue
John
M ary
Slide 33
JobD esc
C om p E ng
P rogram m er
S ec Leader
Technician
C om p E ng
Technician
S ec Leader
P rogram m er
C om p E ng
R ate$
65
60
75
55
65
55
75
60
65
H ours
5
13
7
78
4
15
8
10
14
P r o jID
P1
P1
P1
P2
P2
P3
P3
P3
P4
PNam e
R o lle r
R o lle r
R o lle r
W h is t le
W h is t le
B ig B o y
B ig B o y
B ig B o y
W o lf
ProjID
E m p ID
E101
E102
E104
E103
E101
E103
E104
E102
E101
EN am e
M a ry
John
Sue
B ill
M a ry
B ill
Sue
John
M a ry
JobD esc
C om p Eng
P ro g ra m m e r
Sec Leader
T e c h n ic ia n
C om p Eng
T e c h n ic ia n
Sec Leader
P ro g ra m m e r
C om p Eng
Database Design
Slide 34
R a te $
65
60
75
55
65
55
75
60
65
Rate$
H o u rs
5
13
7
78
4
15
8
10
14
Hours
ProjID
reduce redundancies
PName
reduce anomalies
EmpID EName JobDesc
Rate$
Transitive
Dependency
ProjID
Database Design
Slide 35
EmpID
Hours
INFO204 Distributed Computing Technologies. Martin Sutton
Database Design
Slide 36
Rate$
Transitive
Dependency
Database Design
Slide 37
Slide 38
OrderID
C om pany
X YZ
A cm e
A lpha
Company
Slide 39
OrderID
Database Design
Slide 40
O r d e r ID
O 2 1
O 2 1
O 2 1
O 3
O 3
O 3
O 7
O 7
O 7
Item
Ite m
G r o o z le
C h im e r a
F lu d g e r
F lu d g e r
G r o o z le
S c r im p o t
G r o o z le
S c r im p o t
C h im e r a
Qty
Q ty
5
3
7
7 8
4
1 5
8
1
1
D is c
0
0
0
2 0
0
1 0
0
0
0
Disc
OrderID
Company
Item
PName
Qty
Rate$
Transitive
Dependency
Qty
Database Design
Disc
Slide 41
ProjID
INFO204 Distributed Computing Technologies. Martin Sutton
PName
ProjID
Database Design
Slide 43
EmpID
JobDesc
Rate$
Hours
INFO204 Distributed Computing Technologies. Martin Sutton
Database Design
Slide 42
EmpID
Hours
INFO204 Distributed Computing Technologies. Martin Sutton