Database Management System (Solution)
Database Management System (Solution)
Database Management System (Solution)
(Solution)
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
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.
Solution: Option A
In the E-R model, all the relations produced are default in 1NF.
Solution: Option A
1
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
Solution: Option D
3NF is inadequate means "3 NF is not satisfied". There is a chance that 3 NF is not satisfied
a: When they are multiple candidate keys.
b: When the candidate key has more than one attribute.
c: When they are overlapped candidate keys.
In all the above cases, partial dependency may present, so 3 NF is not satisfied.
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.
Next consider the following set of decompositions for the relation schema R:
D1= {R1,R2,R3,R4}: R1={M,N,O,P}, R 2={M,P,Q}, R 3= {N,R}, R4={R,S,T}
D2= {R1,R2,R3,R4}: R1={M,N,O}, R 2= {P,Q}, R 3= {N,R}, R 4= {R,S,T}
Solution: Option A
Refer to 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)
2
A BC, B C, A B, AB C
Solution: Option D
Canonical cover of a set of FD’s are the minimum no. of FD’s required to cover all the other
remaining FD’s.
If we apply the method mentioned in video to find minimal cover, In second step after
removing redundant FD's the FD's remained will be A->B and B->C, since in LHS of all FD's
contains only one attribute , there is no need of applying step 3, so the answer is option D.
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
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
3
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
3 NF is adequate for relational database design, though BCNF guarantees less redundancy
than 3NF, We cannot guarantee always FD preserving in BCNF, where as in 3NF we can
always guarantee FD preserving.
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. 1NFB. 2NFC. 3NFD. 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.
Solution: Option B
From relation:
X Y
Y Z
By IR3 (transitive rule):
X Z-----(A)
4
From:
X W
X Y
By IR5 (Union rule):
X W-----(C)
But option (B) does not hold under any rule.
Solution: Option D
Candidate key= S, T, U, V
The answer is option D. Because the original relation R is in BCNF as each attribute is a
candidate key. Hence, any decomposition should also be in BCNF
Solution: Option B
If closures of F and G are available, then by BCNF definition we can identify the
decomposition.
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
5
roll_number name
The highest normal form of this relation schema is:
A. 2NF B. 3NFC. 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
Solution: Option D
Refer the videos of finding candidate key.
18. Consider the 2 relation schema: R 1= (A, B, C, D, E) and R 2= (A, B, C, D, E). Statement 1 is
the FD of R1 and statement 2 is the FD of R 2 .
1. A B, AB C, D AC, D E
2. A BC, D AE
Solution: Option A
R1: A B
AB C
D AC
6
D E
Candidate key for R 1 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 R 1 and R2 contains atleast one different attribute
then they would be incomparable.
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 B
Explanation: