Database Sheet Norm
Database Sheet Norm
(a)
Find all 4NF violations. For any that you find, explain why each is a violation, or explain
why none are violations.
(b)
Decompose the relations into a collection of relation schemas in 4NF.
(c)
Consider the original relation R(A,B,C,D) with multivalued dependency AC ->->D and
functional dependency B->A. Which of the following hold? For each, give reasons why it
holds or at least one counterexample
i.
B ->-> CD
ii.
A ->-> D
iii.
AC -> D
Write in relational algebra the following queries. You may write a sequence of steps with
named temporary relations if you like.
(a)
Find the email of the customer(s) with name "Laura Lee."
(b)
Find the names of the customers whose orders were placed on Jan. 1, 2000, and whose
order status is "lost."
(c)
Find the descriptions of the items ordered by "Laura Lee."
(d)
Find the names of the customers who have two or more orders with status "pending."
a)
Find the names of all graduate students who are neither an RA nor a TA.
b)
Find the names of all graduate students who are an RA or a TA in a department other
than their own.
(a)
What are all the nontrivial functional dependencies that follow from the given
dependencies? You need report only those that have singleton right sides and minimal
left sides; e.g., you do not have to report XY->F if X->F is a given or inferred FD.
(b)
What are all the keys of R?
(c)
How many superkeys for R are there that are not keys? Explain your reasoning for partial
credit.
(d)
Which of the 4 given dependencies violate BCNF, if any?
(e)
Which of the 4 given dependencies violate 3NF, if any?
(f)
Suppose we decompose relation R(A,B,C,D,E) into relation S(A,B,C) and other relations.
Give the nontrivial functional dependencies that hold in S. Your answer must include
derived dependencies, but as in part (a) it is sufficient to limit your answer to FD's with
singleton right sides and minimal left sides.
A -> D
AB -> C
B -> E
D -> C
E -> A
Now suppose that we decompose relation R so that one of the new relations is
R1(A,B,C). Given the complete set of FD's above, specify all keys for R1. Don't forget
that a key must be minimal, i.e., no strict subset of the attributes in a key can also form a
key.
6. A database designer has as their first assignment to design the schema for a company
database. Each employee has an ID (unique across employees), Name, Address, Office,
and Salary. The designer decides to create the following four relations:
EmpName(ID, Name)
EmpAddress(ID, Address)
EmpOffice(ID, Office)
EmpSalary(ID, Salary)
a)
State the completely nontrivial functional dependencies for each relation.
b)
Are all four relations in Boyce-Codd Normal Form (BCNF)?
c)
Is this a good database design? Why or why not?
7. Given below is the set F of functional dependencies for the relational schema R = {A, B,
C, D, E, F, G, H, I, J}.
H, D -> A
D -> E, F, G
H, D, B -> C, J
H -> I, J
A -> B, C
8. Given below is the set F of functional dependencies for the relational schema R = {F, T,
D, N, S}.
F -> D
D, T -> F
F, N -> S