Chapter 3 The Relational Database Model
Chapter 3 The Relational Database Model
INTRODUCTION TO DATABASE
MANAGEMENT SYSTEM
By :
Miss Noorfadzilah Arifin
A ➔B
✓ A determines B
✓ B is functionally dependent on A
A ➔ B,C,D
✓ attribute A determines attributes B,C,D
✓ B,C,D are functionally dependent on A
A,B ➔ C
✓ attributes A,B determine attribute C
✓ attributes C is fully functionally dependent on A,B
Keys
8
Composite key
✓ Composed of more than one attribute OR multi-
attribute key
Key attribute
✓ Any attribute that is part of a key
Superkey
✓ Any key that uniquely identifies each row
Candidate key
✓ A superkey without redundancies OR a minimal
superkey
Keys
9
Referential integrity
✓ FK contains a value that refers to an existing
valid row in another relation
Secondary key
✓ Key used strictly for data retrieval purposes
Keys
10
Nulls:
✓ No data entry
✓ Not permitted in primary key
✓ Should be avoided in other attributes
✓ If used improperly, can create problems because they
have many different meanings. For example, can
represent
◼ An unknown attribute value
◼ A known, but missing, attribute value
◼ A “not applicable” condition
✓ Can create problems when functions such as COUNT,
AVERAGE, and SUM are used
✓ Can create logical problems when relational tables are
linked
Keys
11
Data dictionary
System catalog
✓ Contains metadata
1:M relationship
✓ Relational modeling ideal
✓ Should be the norm in any relational database
design
1:1 relationship
✓ Should be rare in any relational database design
M:N relationships
✓ Cannot be implemented as such in the relational
model
✓ M:N relationships can be changed into two set of
1:M relationships
Relationships within the Relational
Database
21
Foreign keys
✓ Control data redundancies by using common
attributes shared by tables
34
Data Redundancy Revisited
35
Indexes
36
Unique index
✓ Index in which the index key can have only one pointer
value (row) associated with it