Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Database Management System (Solution)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

DATABASE MANAGEMENT SYSTEM

(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

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 A
In the E-R model, all the relations produced are default in 1NF.

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

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.

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}, 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}

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

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

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

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


A. Y⊆ X B. X⊂ Y 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. 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.

13. Given the functional dependencies:


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

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)

4
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 R 1∩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
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

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.

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

Which of the following is 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 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

Which of the following statements is true?


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

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.

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. 3NFD. 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 B
Explanation:

From the given relations, the following FD’s can be inferred:


empcode  pincode city state name street
pincode  city state
city state street  pincode
Key for relation is thus {empcode}
Therefore, Prime attribute= {empcode}
Since there is only one prime attribute, there are no partial dependencies. So, the given relation
is in 2 NF.
Here transitive dependencies are present ( (pincode  city state), (city state street 
pincode)). So the given relation is not in 3 NF. So the answer is option B.

You might also like