You are on page 1of 10

Database Management System: Assignment 4

Total Marks : 20

March 18, 2019

Question 1
Identify the correct statement about the decompositions demonstrated below: (where p, q, r
are column names)

Marks: 2 MCQ

p q r p q q r
i) a 1 x → a 1 1 x
b 2 y b 2 2 y

p q r p q q r
ii) a 1 x → a 1 1 x
b 1 y b 1 1 y

a) i) is lossless, ii) is lossy

b) ii) is lossless, i) is lossy

c) i) and ii) both are lossless

d) i) and ii) both are lossy

Answer: a)

p q r
a 1 x
Explanation: Join between the tables of ii) is returning: a 1 y which is not the
b 1 x
b 1 y
original table, hence the decomposition is lossy.

1
Question 2
Find the functional dependencies that stands valid on the part of the relation shown below:

Marks: 2 MCQ

p q r
a 1 x
a 2 x
b 3 x
b 4 x

a) p→ q, p → r

b) q → p, p → r

c) q → p, r → p, p → r

d) p → q, p → r, r → p

Answer: b)

Explanation: p cannot uniquely determine q, because for the same value of p multiple
values of r are obtained. So p → q is false. a) and d) are false hence. r→ p is also false because
unique value of r determines multiple values of p. So c) is false. b) is true because for unique
values of q, unique value of p is determined and unique value of p determines unique value of r.

2
Question 3
Identify the prime and non prime attributes from the given Functional dependencies:

Marks: 2 MCQ

R(mnopqrst), F=(q→rst, mn→pqrst, o→pq, p→m)

a) m, n are prime attributes and o, r, s, t are non prime attributes.

b) o, n are prime attributes and m, p, s, t are non prime attributes.

c) m, r, p, t are prime attributes and n, o, s, q are non prime attributes.

d) m, n, o, p are prime attributes and q, r, s, t are non prime attributes.

Answer: d)

Explanation: (M N )+ , (N O)+ , (N P )+ determines the entire attribute set of the rela-


tion. Hence M, N, O, P are prime, whereas Q, R, S, T are non prime because they are not
part of any candidate keys.

3
Question 4
Which highest normal form is guaranteed by the following relation?

Marks: 2 MCQ

dept ID dept Name salary

D1 Sales 50000
D2 Software 40000
D3 Finance 37000
D4 Marketing 45000

a) 1NF

b) 2NF

c) 3NF

d) BCNF

Answer: b)

Explanation: All the fields have atomic values and no partial dependencies exist. But
transitive dependency exists because dept ID → dept Name and dept Name → salary implies
dept ID → salary. So the relation is not in 3NF.

4
Question 5
Relation R=(a, b, c, d, e, g) having the functional dependencies F=(a→b, bg→e, c→d,
d→g). Find the candidate key.

Marks: 2 MCQ

a) ag

b) abc

c) ac

d) abd

Answer: c)

Explanation: Closure of(ac) determines all the attributes of R.


(ac)+ =(a, b, c, d) [since a→b and c→d]
=(a, b, c, d, g) [since d→g]
=a, b, c, d, g, e) [since bg→e]

Closure of (abc ) also determines all the attributes. But candidate key means minimal set
of superkey. (ac) is the minimal set and hence the candidate key.

5
Question 6
The canonical cover of R=(a, b, c) where F=(a→bc, b→c, a→b, ab→c) is:

Marks: 2 MCQ

a) a→bc

b) a→b, b→c

c) a→b, ab→c

d) a→bc, ab→c

Answer: b)

Explanation: a→b and b→c determines a→c(transitivity). So a→c and b→c determines
ab→c. So the FD ab→c is reduntant. After removing ab→c we have (a→bc, b→c, a→b).
Again a→b and a→c determines a→bc(union). So the FD a→bc is also reduntant. So the
canonical cover is (b→c, a→b).

6
Question 7
R(a, b, c) have F=(ab→c, c→b). The table is not in which normal form:

Marks: 2 MCQ

a) 1NF

b) 2NF

c) 3NF

d) BCNF

Answer: d)

Explanation: The relation satisfies 1NF and 2NF because there is atomic values in each
attribute and no partial dependencies exists. The relation is in 3NF because there is no tran-
sitive dependency in the relation. But the relation is not in BCNF because c→b and c is not
a superkey, which violates the law of BCNF.

7
Question 8
In the following relation R suppose the following functional dependency holds:
F=(m→n, np→g, o→p, q→p, n→q)
The closure of (n)+ is:
Marks: 2 MCQ

a) (n, m, q, p, g)

b) (n, q, p, g)

c) (n, o, p, q)

d) (n, q, g, o)

Answer: b)

Explanation: (n)+ =(n, q) [Since n→q]


=(n, q, p) [Since q→p]
=(n, q, p, g) [Since np→g]

8
Question 9
The following relation guarantees which highest normal form?

Marks: 2 MCQ

sid sname course teacher

S1 RAM C AR
S2 MADHU DBMS PPD
S1 RAM DBMS PB
S2 MADHU C SM

a) 1NF

b) 2NF

c) BCNF

d) 3NF

Answer: a)

Explanation: The relation contains atomic values so it is in 1NF. The primary key of the
relation is (sid, course). But sid can uniquely determine sname. So partial dependency
exists. Hence the relation is not in 2NF and not also in higher normalization forms.

9
Question 10
The following relation guarantees which normal form?

Marks: 2 MCQ

course teacher subject

C AR POINTER
C SM POINTER
DBMS PPD NORMALISATION
DBMS PPD TRANSACTION
DBMS AR TRANSACTION
C SM STRUCTURE

a) 2NF

b) 3NF

c) 4NF(multivalued)

d) 1NF

Answer: b)

Explanation: The relation has atomic values so the relation is in 1NF. The primary key is
(course, teacher, subject). No partial and transitive dependency exists. So the relation
is in 3NF. But since multivalued dependency exists, so the relation is not in 4NF.

Multivalued dependency: In the above relation for each unique value in course, multiple
teachers are assigned and again same teacher teaches more than one course. Moreover the
same subject of the same course are taught by more than one teacher. This is called
multivalued dependency. So a single record in the above relation can be uniquely identified by
taking (course, teacher, subject) together.

10

You might also like