You are on page 1of 7

DATABASE MANAGEMENT SYSTEM

(Solutions)

1. For a database relation R (a, b, c, d) where the domains of a, b, c and d only include atomic
values, only the following functional dependency and those that can be inferred from them
hold: a  c , b  d

The relation is in:


A. 1NF but not in 2NF
B. 2NF but not in3NF
C. 3NF
D. None of the above

Solution: Option A
Since, it is already mentioned that a, b, c, d are atomic values, so by definition of
1NF, it can be inferred that it is already in 1NF.
But as a c
b d, the candidate key is  {ab}
So, all the non-key attributes only partially depend on the prime attributes of the candidate
key(a and b). So, it is not in 2NF.

2. Relation produced from an E-R model will always be in:


A. 1NF B. 2NF C. 3NF D. 4NF

Solution: Option C
In the E-R model, all the relations produced are default in 3NF.

3. Choose the correct statement:


A. An alternative key is a candidate key that is not a primary key.
B. An alternate key is a primary key that is not a candidate key.
C. An alternate key is a candidate key that is also a primary key.
D. None of these.

Solution: Option A

4. 3NF is inadequate in situations where the relation:


A. has multiple candidates key
B. has candidate key that are composite
C. has overlapped candidate keys
D. all the above

1
Solution: Option D
Refer the videos related to 3NF mentioned in the lectures.

5. If a relation is in BCNF, it is also in:


A.1NF B. 2NF C. 3NF D. All of the above

Solution: Option D
BCNF satisfied all the conditions that are followed from 1NF and 2NF and is more
strict than 3NF in the sense for the FD: X Y, BCNF states X must be a candidate
key, unlike 3NF.

6. Consider a relation R= {M, N, O,P, Q, R, S, T} with the following set of dependencies:


MN Q
M RQ
N R
R ST

Next consider the following set of decompositions for the relation schema R:
D1= {R1,R2,R3,R4}: R1={M,N,O,P}, R2={M,P,Q}, R3= {N,R}, R4={R,S,T}
D2= {R1,R2,R3,R4}: R1={M,N,O}, R2= {P,Q}, R3= {N,R}, R4= {R,S,T}

Which of the above decomposition (1) has/ have lossless join property?
A. Only D1 B. Only D2 C. Both D1 and D2 D. Neither D1 nor D2

Solution: Option A
Consult the videos regarding checking of lossless join and functional dependency
preserving. Study some of the examples as well for further practice.

7. Consider the following set of functional dependency on the scheme (A, B,C)
ABC, BC, A B, ABC

The canonical cover for this set is:


(A) ABC and B C
B. ABC and AB C
C. A BC and A B
D. A B and B C

Solution: Option A
Canonical cover of a set of FD’s are the minimum no. of FD’s required to cover all

2
the other remaining FD’s.
For Option B:
A BC
A C
It can cover A B but not B C (by decomposition rule)
For Option C:
A BC
A B
It cannot cover AB C or B C
For Option D:
A B
B C
By transitivity rule: A C and by
A B and A C
Union rule is: A BC
but cannot cover: AB C
But Option A cover all the FD’s:
A BC ----(i)
B C ----(ii)
(i) can be decomposed to:
A B
A C-----(iii)
(ii) and (iii) by pseudo transitive rule, it can be written as:
AB C

8. Which of the following statements is FALSE?


A. Any relation with 2 attributes is in BCNF
B. A relation in which every key has only one attribute is in 2NF
C. A prime attribute can be transitively dependent on a key in a 3NF relation
D. A prime attribute can be transitively dependent on a key in a BCNF relation

Solution: Option D
Consider the functional dependency: X Y.
3NF permits this dependency if Y is a primary key attribute and X is not a
candidate key. However, BCNF doesn’t permits this. It insists that X be a
candidate key.

9. The following functional dependency hold for relations R (A,B,C) and S(B,D,E):
B  A, A  C
The relation R contains 200 tuples and the relation contains 100 tuples. What is the maximum

3
number of tuples possible in natural join R S?

Solution: Option A
Since A is functionally dependent on B, you can derive the value of A from the
value of B. Since C is functionally dependent on A, you can derive the value of
C from the value of A. So, in essence, if you know the value of B, you will know
the values of A and C. If 2 rows of a relation R have the same value for
attribute B, the 2 rows become identical, and they have become duplicate rows.
Since, relational doesn’t store duplicate rows (in general), all the 200 tuples of
relation R are different. Since natural join is the equi join on common
attribute B, it will have maximum 100 tuples.

10. Which normal form is considered adequate for relational database design?
A. 2NF B. 3NF C. 4NF D. BCNF

Solution: Option B
3NF is considered adequate, as BCNF is just stricter form of 3NF, and 4NF
stands for multivalued dependency.

11. A functional dependency of the form X Y is trivial if:


A. Y⊆X B. Y⊂X C. X⊆Y D. X⊂Y and Y⊂X

Solution: Option A
Take for ex. A realtion R (A, B) A B
For this relation: a1 b1
A A will always hold again a2 b2
AB A will always hold as well a1 b3

12. If every non-key attribute is functionally dependent on the primary key then the relation will
be in:
A. 1NF B. 2NF C. 3NF D. 4NF

Solution: Option C
A table or relation is said to be in 3NF if:
 It satisfies 2NF
 Every non-prime attribute in the table should depend on primary key.
The functional transitive dependency is removed from the table. This
helps in reducing data duplication and achieving data integrity.

13. Given the functional dependencies:


XW; XY; YZ and Z PQ

4
Which of the following does not hold good?
A. X Z B. W Z C. X WY D. None of these

Solution: Option B
From relation:
X Y
Y Z
By IR3 (transitive rule):
XZ-----(A)
From:
X W
X Y
By IR5 (Union rule):
X W-----(C)
But option (B) does not hold under any rule.

14. Consider the schema R=(S, T, U, V) and dependency be ST, T U, U V, V S.


Let R= (R1 and R2) be a decomposition such that R1∩R2.

The decomposition is:


A. Not in 2NF
B. In 2NF but not in 3NF
C. In 3NF but not in 2NF
D. In both 2NF and 3 NF

Solution: Option D
Candidate key= S, T, U, V
Decomposition is in both 2NF and 3NF. Because S is a candidate key and there
is no partial dependency and transitive dependency held.

15. Relation R is decomposed using a set of functional dependency F, and relation S is


decomposed using another set of functional dependencies G. One decomposition is definitely
BCNF, the other is definitely 3NF, but is not known to make a guaranteed identification.
Which of the following tests should be used for the decomposition? (Assume that closure of
F and G are available)
A. Dependency preservation
B. BCNF definition
C. Both (A) and (B)
D. 3NF definition

Solution: Option B
If closures of F and G are available, then by BCNF definition we can identify the
decomposition.

5
16. The relation schema: student_performance (name, course_number, roll_number, grade) has
the following functional dependencies:
name, course_number grade
roll_number, course_number grade
nameroll_number
roll_number name
The highest normal form of this relation schema is:
A. 2NF B. 3NF C. BCNF D. 4NF

Solution: Option B
The candidate keys are {name, course_number} and {course_number, roll_number}
Dependency 3 and 4 are transitive but they are prime, so we will break this relation
upto 3NF.

17. Relation R has attributes A, B, C, D, E, F, G, H, I and J and satisfies the following functional
dependencies:
ABD E
CJ
B G
CI I
B F
G HI

Which of the following is not a candidate key of R?


A. A, B, C, I
B. A, B, C, D, G
C. A, B, C, D, E
D. A, B, C, D

Solution: Option A
Refer the videos of finding candidate key.

18. Consider the 2 relation schema: R1= (A, B, C, D, E) and R2= (A, B, C, D, E). Statement 1 is
the FD of R1 and statement 2 is the FD of R2.
1. A B, AB C, D AC, D E
2. A BC, D AE

Which of the following statements is true?


A. FD of R1 is equivalent to FD of R2
B. FD of R1 and R2 not equivalent
C. We cannot compare FD of R1 and R2
D. None of the above

Solution: Option A
R1: AB
AB C

6
D AC
D E
Candidate key for R1 is AD closure of FD is :
{A B, AB C, A C, D AC, D A, D C, D E}
R2: A BC
D AE
Candidate key for R2 is AD and closure of FD is:
{AB, AC, ABC, DA, DC, DE, DAC}

Alternative approach:
Find closure of each attribute in R1 and R2 respectively. If they match then they
are equivalent else not. If both R1 and R2 contains atleast one different attribute
then they would be incomparable.

19. Given R (A, B, C, D, E, F) and F={ABC, D E, E F, D A}


What is the highest normal form of R?
A. 1NF B. 2NF C. 3NF D. BCNF

Solution: Option A
First find candidate key and refer the video and examples and then solve the
problem.

20. A relation empdtl is defined with attribute empcode(unique), name, street, city, state and
pincode. For any pincode, there is only one city and state. Also for any given street, city and
state there is just one pincode. In normalization, empdtl is a relation in:
A. 1NF
B. 2NF and hence also in 1NF
C. 3NF and hence also in 2NF and 1NF
D. BCNF and hence also in 3NF, 2NF and 1NF

Solution: Option A
From the given relations, the following FD’s can be inferred:
Pincode city state
City state street pincode
Key for relation is thus {empcode, name, pincode, street}
Therefore, Prime attribute= {empcode, name, pincode, street}
Now the Fd’s :
Pincode city state} 1NF
City state street pincode 1NF

You might also like