You are on page 1of 4

1

Database Systems: Assignment 1


A. Example of a relational database
Assume that we wish to maintain a database that contains the flight information
of an airline during one particular year. This database maintains information
about flights, pilots, and assignments of pilots to flights. Each flight has a unique
flight number, a departure city, a destination city, a departure time, and an arrival
time. Each pilot has a unique company ID, a name, and an experience level.
Pilots are assigned to certain flights on particular days of the year.
1. Using this description of the database, identify the data objects and a
relationship that need to be maintained in the database.
2. For each data object specify its relevant attributes and identify its primary key.
3. For the relationship, determine its attribute(s) and identify its foreign keys.
4. Use relational tables to represent the data objects and relationships with their
attributes and constraints.

B. Please answer the following questions with examples.


a. What is the referential integrity constraint in the domain of relational data
model?
EMPLOYEE
FNAME
John
Franklin
Jennifer
Joyce
James

MINIT
B
T
S
A
E

LNAME
Smith
Wong
Wallace
English
Borg

SSN
123456789
333445555
987654321
453453453
888665555

SEX
M
M
F
F
M

SALARY
30000
40000
43000
25000
55000

SUPERSSN
333445555
888665555
888665555
333445555
Null

DNO
5
5
4
5
1

DEPARTMENT
DNAME
Research
Administration
Headquarters

DNUMBER
5
4
1

MGRSSN
3333445555
987654321
888665555

MGRSTARTDATE
1988-05-22
1995-01-01
1981-06-19

b. What is the recursive referential integrity constraint in the domain of relational


data model?
EMPLOYEE

2
FNAME
John
Franklin
Jennifer
Joyce
James

MINIT
B
T
S
A
E

LNAME
Smith
Wong
Wallace
English
Borg

SSN
123456789
333445555
987654321
453453453
888665555

SEX
M
M
F
F
M

SALARY
30000
40000
43000
25000
55000

SUPERSSN
333445555
888665555
888665555
333445555
Null

DNO
5
5
4
5
1

c. What is the mutual recursive referential integrity constraint in the domain of


relational data model?

3
EMPLOYEE
FNAME
John
Franklin
Jennifer
Joyce
James

MINIT
B
T
S
A
E

LNAME
Smith
Wong
Wallace
English
Borg

SSN
123456789
333445555
987654321
453453453
888665555

SEX
M
M
F
F
M

SALARY
30000
40000
43000
25000
55000

SUPERSSN
333445555
888665555
888665555
333445555
Null

DEPARTMENT
DNAME
Research
Administration
Headquarters

DNUMBER
5
4
1

MGRSSN
3333445555
987654321
888665555

MGRSTARTDATE
1988-05-22
1995-01-01
1981-06-19

DNO
5
5
4
5
1

Question C
7.19 Suppose that each of the following update operations is applied directly to the
database of Figure 7.7. Discuss all integrity constraints violated by each operation,
if any, and the different ways of enforcing these constraints.
a. Insert <Robert, F, Scott, 943775543, 1952-06-21, 2365 Newcastle Rd,
Bellaire, TX, M, 58000, 888665555, 1> into EMPLOYEE.
b. Insert <ProductA, 4, Bellaire, 2> into PROJECT.
c. Insert <Production, 4, 943775543, 1998-10-01> into DEPARTMENT.
d. Insert <677678989, null, 40.0> into WORKS_ON.
e. Insert <453453453, John, M, 1970-12-12, SPOUSE> into DEPENDENT.
f. Delete the WORKS_ON tuples with ESSN = 333445555.
g. Delete the EMPLOYEE tuple with SSN = 987654321.
h. Delete the Project tuple with PNAME = ProductX.
i. Modify the MGRSSN and MGRSTARTDATE of the DEPARTMENT tuple with
DNUMBER = 5 to 123456789 and 1999-10-01, respectively.
j. Modify the SUPERSSN attribute of the EMPLOYEE tuple with SSN =
999887777 to 943775543.
k. Modify the HOURS attribute of the WORKS_ON tuple with ESSN = 999887777
and PNO = 10 to 5.0.

You might also like