0% found this document useful (0 votes)
12 views

Database Sheet Norm

The document discusses database normalization and relational algebra. It contains 8 problems about functional dependencies, keys, normal forms, and decomposing relations. The problems involve identifying functional dependencies, keys, violations of normal forms, and decomposing relations into BCNF and 3NF.

Uploaded by

mennah samy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Database Sheet Norm

The document discusses database normalization and relational algebra. It contains 8 problems about functional dependencies, keys, normal forms, and decomposing relations. The problems involve identifying functional dependencies, keys, violations of normal forms, and decomposing relations into BCNF and 3NF.

Uploaded by

mennah samy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Database Systems

Dr. Yasser Fouad


Sheet Normalization
1. Consider a relation R(A,B,C,D) with multivalued dependency AC->->D and functional
dependency B->A.

(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

2. This problem is based on the relations:

Customers(custID, name, email, shipAddr)


Orders(orderID, custID, itemID, date, status)
Items(itemID, description)

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."

3. Consider the following relational database schema:

Student(ID, name, dept, status) // status = "grad" or "undergrad"


// ID is a key
RA(ID, advisor, dept) // (ID,advisor) together are a key
TA(ID, course, dept) // (ID,course) together are a key

Write the following in relational algebra:

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.

4. Consider a relation with schema R(A,B,C,D,E) and functional dependencies


B->E, C->D, E->A, DA ->B

(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.

5. Consider a relation R(A,B,C,D,E). Suppose that the following five functional


dependencies hold on R:

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

a. Find a minimal key for this relation.


b. Decompose the relation into a collection of relations that are in 3rd normal form
and BCNF.

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

a. Find a minimal key for this relation.


b. Decompose the relation into a collection of relations that are in BCNF.
c. Now decompose this relation into a collection of relations that are in 3NF.

You might also like