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

Assignment Normalization

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

Assignment Normalization

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

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: AB, 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. AB, 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. CD, CA. B C
2. BC, DA
3. ABCD, DA
4. AB. BD, AC
5. ABC, ABD. CA, DB
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. BC, DA ; decompose into BC and AD
ii. ABC, CA, CD ; decompose into ACD and BC
iii. ABC, CAD; decompose into ABC, AD
iv. AB, BC, CD; decompose into AB and ACD
v. AB, BC, CD; 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:
ABC, CD E, BD, EA
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.

7. Explain how functional dependencies can be used to indicate the following:


a. A one-to-one relationship exists between entity sets student and instructor
b. A many-to-one relationship set exists between entity sets student and instructor
8. Compute the closure of the Following set F of FDs for relations schema r(A, B,C,D,E)
ABC, CDE, BD, EA
a. list the candidate keys for R
b. Compute canonical cover Fc
9. Given the database schema R(a, b, c), and a relation r on the schema R, write an SQL query to test
whether the functional dependency b → c holds on relation r .
10. Normalize the following schema, with given constraints to 4 NF
books(accessionno, isbn, title, author, publisher)
users(userid, name, deptid, deptname)
accessionno isbn, isbn title, isbnpublisher, isbnauthor, useridname
useriddeptid, deptiddeptname
11. Consider the following set F of dependencies on the relation schema r(A,B,C,D,E,F):
ABCD, BD, BCDE, DA
a. compute B+
b. compute a canonical cover for the above set of FDs F give each step of your
derivation with an explanation
c. give a 3NF decomposition of r
d. give a BCNF decomposition of r

12. Given R = (A,B,C,G,H,I) and F: { AB, BHI, CGH), state if R is in 4NF. If R is


not in 4NF decompose R into sub relations to achieve 4 NF sub relations.
13. Consider the relation given below:

Company Product Supplier


HLL Soap Raju
HLL Soap Ram
HLL Shampoo Ram
Godrej Soap Raju
Godrej Shampoo Raju
Godrej Shampoo Ram
Godrej Shampoo Ritesh
Is the relation in 4 NF? can the relation be non-loss decomposed further? Can we say the
relation is in 5 NF?

14. An investment firm’s database schema is represented by R(B,O,I,S,Q,D)


B: Broker, O: office of Broker, I: Investor, S: Stock, Q: Quantity of stock owned by an
investor, D: Dividend paid by a stock
the following FDs are required to hold on this Database
IB, ISQ, BO, SD
a. What are the candidate keys for R
b. Is R in BCNF? If not decompose R in to sub relations that are in BCNF
c. Do the sub relations preserve FDs?, if not decompose R into 3 NF preserving FDs

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

a. Identify the functional dependencies that hold on relation Interview.


b. Identify the candidate keys
c. State if the relation is in BCNF. Give reasons for your answer.
d. If the relation is not in BCNF, decompose the relation into sub relations that are
in BCNF. Indicate all your considerations in decomposing the relation.

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.

You might also like