Database Design: Artificial, Composite, and Secondary Uids
Database Design: Artificial, Composite, and Secondary Uids
Database Design: Artificial, Composite, and Secondary Uids
Objectives
This lesson covers the following objectives:
Define the different types of unique identifiers (UIDs)
Define a candidate UID and explain why an entity can
sometimes have more than one candidate UID
Analyze business rules and choose the most suitable
primary UID from the candidates
Recognize and discuss the issues of identification in the
real world
Purpose
The unique identifier (UID) is very important in relational
databases.
It is the value or combination of values that enables the
user to find that one unique item among all the rest.
Identifying just the right attribute, or combination of
attributes and relationships, is a skill that any database
designer must master. The unique identifier enables you
to find your record in a file, a particular card in a deck of
cards, your package in a warehouse, or a specific piece of
data in a database.
3
Simple Unique
Identifier
CONCERT TICKET
# date of performance
# seat number
Composite Unique
Identifier
Artificial UIDs
Artificial UIDs are those that dont occur in the natural
world but are created for purposes of identification in a
system.
People are not born with numbers, but a lot of systems
assign unique numbers to identify people: student
numbers, customer IDs, etc.
SHOE
* color
* size
* style
Create an
artificial UID
SHOE
# shoe ID
* color
* size
* style
SHOE
* color
* size
* style
Create an
artificial UID
SHOE
# shoe ID
* color
* size
* style
STUDENT
# student ID
* first name
* last name
Create an artificial UID * address
at
have
BANK
# number
* name
* location
for
for
have
EVENT
# id
* cost
* name
* date
o description
on
SONG
# id
* title
o artist
o duration
CATALOG ITEM
# number
* price
PRODUCT
# code
* description
10
MANUFACTURER
# number
* name
CATALOG ITEM
# number
* price
PRODUCT
# code
* description
11
MANUFACTURER
# number
* name
12
CATALOG ITEM
# number
* price
PRODUCT
# code
* description
MANUFACTURER
# number
* name
Candidate UIDs
Sometimes two or more possible UIDs exist. For
example, when you order a product from a commercial
website, you will usually be assigned a unique customer
code and asked to enter your e-mail address.
Each of these uniquely identifies you, and each could be
chosen as the UID. These are both candidate UIDs.
Only one of the candidate UIDs is chosen as the actual
UID. This is called the primary UID. The other
candidates are called secondary UIDs.
13
STUDENT
# student ID
(#) badge number
* first name
* last name
* address
STUDENT
# student ID
(#1) badge number
(#2-1) first name
(#2-2) last name
* address
15
Terminology
Key terms used in this lesson included:
Artificial UID
Candidate UID
Composite UID
Primary UID
Secondary UID
Simple UID
UID
16
Summary
In this lesson, you should have learned how to:
Define the different types of unique identifiers (UIDs)
Define a candidate UID and explain why an entity can
sometimes have more than one candidate UID
Analyze business rules and choose the most suitable
primary UID from the candidates
Recognize and discuss the issues of identification in the
real world
17