Professional Documents
Culture Documents
Employees Database
Employee Table
Branch Table
number phone_type
4335667 home
021654321 mobile
02096543 mobile
8334567 home
y keys and foreign keys in the tables - add any that are missing. For this simple example we assume people cannot
ers - each phone number is unique and belongs to one person.
example we assume people cannot
Ex 1. Employees Database
Employee Table
Branch Table
eys (FKey). We had to add employee_id to the Phone table to link the phone numbers with the employees.
employee_id (FKey)
1002
1002
1008
1010
appointment_number reason
6000 Checkup
6000 Broken Tooth
6001 Checkup
6002 Crown Fitting
6003 Cleaning
6003 Checkup
Reason Table
reason
Broken Tooth
Checkup
Cleaning
Crown Fitting
staff_number patient_number surgery_room_number
S1000 P100 1
S1000 P105 2
S1010 P208 2
S1010 P302 1
Staff Table
Patient Table
patient_number first_name last_name
P100 Ann-Marie Rangi
P105 Priya Kaur
P208 Bob Brown
P302 Kerryn Painter
Ex 2. Dental Appointments Database
Appointment Table
Reason Table
reason (PKey)
Broken Tooth
Checkup
Cleaning NOTE: Although there is a surrogate
Crown Fitting
staff_number (FKey) patient_number (FKey) surgery_room_number
S1000 P100 1
S1000 P105 2
S1010 P208 2
S1010 P302 1
Staff Table
Patient Table
patient_number (PKey) first_name last_name
P100 Ann-Marie Rangi
P105 Priya Kaur
P208 Bob Brown
P302 Kerryn Painter
Hotel Table
hotel_code hotel_location
H123 Sydenham
H354 Sumner
Employee Table
ird_num first_name last_name
123456 Anna Kramnik
456789 Jim Green
98765 Taihana Robinson
Hotel Table
hotel_code (PKey) hotel_location
H123 Sydenham
H354 Sumner
Employee Table
ird_num (PKey) first_name
123456 Anna
456789 Jim
98765 Taihana
last_name
Kramnik
Green
Robinson
hours_per_week
10
15
20
Ex 4. Car Sales Database
Car Table
car_registration_number car_make
ABC123 Toyota
DEF234 Subaru
GHI345 Volvo
Salesperson Table
salesperson_id first_name
1002 Hemi
1050 Janet
last_name commission_percentage
Brown 5
Jones 6
Salesperson Table
salesperson_id (PKey) first_name
1002 Hemi
1050 Janet
last_name commission_percentage
Brown 5
Jones 6
BCDE101 Python
Staff Table
staff_id staff_first_name staff_last_name
88765 Chris Bartlett
Student Table
student_id first_name last_name
12345 Bob Brown
34568 Jane Smith
Course Table
code name
BCDE103 Database
BCDE101 Programming
address
10 Main Rd
100 North Rd
grade
A+
D
B
Ex 5. Student Details Database
Keywords Table
course_code (PKey) keyword (PKey)
BCDE103 database
BCDE103 SQL
BCDE101 programming
BCDE101 Python
Staff Table
staff_id (PKey) staff_first_name
88765 Chris
99887 Rob
89898 Someone
Student Table
student_id (PKey) first_name
12345 Bob
34568 Jane
Course Table
code (PKey) name
BCDE103 Database
BCDE101 Programming
staff_last_name
Bartlett
Oliver
Else
last_name address
Brown 10 Main Rd
Smith 100 North Rd
course_semester (PKey)
2022-S1
2022-S1
2022-S1
2022-S2