Assignment Normalization
Assignment Normalization
Note: decomposition of a relation schema R with FDs F into schemas with attribute sets X and Y
is dependency-preserving if (FX U FY)+ = F+
1. Consider a relation R with five attributes A, B,C,D,E. you are given the following
dependencies: AB, BC E, ED A
a. List all Keys for R
b. Is R in 3 NF?
c. Is R in BCNF?
2. Suppose that we have the following 3 tuples in a legal instance of a relation schema S
with three attributes A,B,C ( listed in order): (1,2,3), (4,2,3), (5,3,3).
a. Which of the following dependencies can you infer does not hold over schema S?
i. AB, ii. BC A, iii. B C
b. Can you identify all dependencies that hold over S?
3. Suppose you are given a relation R with four attributes ABCD. F'or each of the following
sets of FDs, assuming those are the only dependencies that hold for R, do the following:
a. Identify the candidate key(s) for R.
b. Identify the best normal form that R satisfies (lNF, 2NF, 3NF, or BCNF).
c. If it is not in BCNF decompose it into a set of BCNF relations that preserve the
dependencies:
1. CD, CA. B C
2. BC, DA
3. ABCD, DA
4. AB. BD, AC
5. ABC, ABD. CA, DB
4. Suppose you are given a relation R(A, B, C, D). for each of the following sets of FDs,
assuming they are the only dependencies that hold for R, do the following
a. Identify the candidate keys for R
b. State whether or not the proposed decomposition of R into smaller relations is a
good decomposition and briefly explain why or why not.
i. BC, DA ; decompose into BC and AD
ii. ABC, CA, CD ; decompose into ACD and BC
iii. ABC, CAD; decompose into ABC, AD
iv. AB, BC, CD; decompose into AB and ACD
v. AB, BC, CD; decompose into AB, AD, CD
5. If you are given the following instances of R1 and R2, what can you say about the
instance of R from which these tuples were obtained.? Answer this question by listing
tuples that are definitely in R (A,B,C) and tuples that are possibly in R.
a. Instance of R1 = {(5,1), (6,1)}
b. Instance of R2 = {(1,8), (1,9)}
c. Can you say that attribute B definitely is or is not a key for R?
6. Suppose that we decompose the schema r(A,B,C,D,E) in to r1(A,B,C) and r2(A,D,E)
a. show that the decomposition is lossless decomposition if the following set F of
FDs holds:
ABC, CD E, BD, EA
Is this decomposition dependency preserving? Give reasons.
b. Is the decomposition of schema into r1(ABC) and r2(C, D, E) a loss-less
decomposition? Give reasons.
15. Consider a chemical analysis lab. Which tests products of various companies. Three
tables exist: LAB, Product, Company. Company can offer one or more products, Labs
can test one or more products from one or more companies. A product can be tested in
one or more labs and can be offered by one or more companies. If a lab is equipped to
analyse a product from a given company, this information can be recorded using a
relation schema
Lab_Product_Company (Lab_Id, Product_Id, Company_Id)
is this relation in 5NF? what better structure of relation schemas do you suggest? What
advantages/disadvantages do you see with the decomposition you suggest?
16. Consider a relation schema employee with attributes Name, Project and Hobby.
Employee works for a project and has a hobby. An employee can work for more than
one project and can have more than one hobby.
a. what type of dependencies do you see holding on the employee schema?
b. Is employee relation in 4 NF?
c. If the employee relation is not in 4 NF, decompose the relation into sub relations
that are in 4 NF.
17. Consider the relation, Interview given below, which contains the details of the
arrangements for interviews of candidates by in-house technical experts of a company.
The interviewers are allocated a specific room on the day of the interview. A room can
be allocated to several interviewers as required, throughout the day. A candidate is
interviewed only once on a given date.
Interview
Candidate_Id Int_date Int_time Intvr_id Room_no
C001 24-May-2017 10:30 E001 R001
C002 24-May-2017 11:30 E001 R001
C003 24-May-2017 10:30 E002 R002
C004 26-May-2017 11:30 E003 R002
18. What normal form the relation Contacts ( Contact_Id, Contact_name, Company_name,
Company_location, phone_number) is in? decompose the relation into sub relations that
preserve 4 NF.