NPTEL DBMS 2 Week 4
NPTEL DBMS 2 Week 4
The candidate keys of CourseAssignments are {QNo, AssignmentNo} and {QNo, Topic}.
Prime attribute is an attribute that is part of any candidate key.
Question - 2
Consider the relational schemaFileRepo(RepoName, FileNo, IndexNo, AdminID,
FileCount) with the following functional dependencies:
RepoName→{AdminID, FileNo}
FileCount→{RepoName, IndexNo}
Which of the following decomposition of FileRepo is lossless?
a) FileRepo1(RepoName, FileNo), FileRepo2(IndexNo, AdminID, FileCount)
b) FileRepo1(RepoName, FileNo), FileRepo2(FileNo, AdminID, FileCount)
c) FileRepo1(RepoName, FileCount), FileRepo2(FileNo, IndexNo, AdminID, FileCount)
d) FileRepo1(RepoName, AdminID), FileRepo2(FileNo, IndexNo, AdminID, FileCount)
Solution - 2
Solution: (c)
Explanation: From the functional dependencies, the primary key of the schema can be
identified as FileCount. In option (c),
F={
________________________________________________________________
QNo → Topic
Topic → Marks
Topic → AssignmentNo
QNo → QType
Solution - 3
Solution: (a)
In the FD {Topic, QNo} → QType, Topic is extraneous in L.H.S as QNo+ contains Topic
from QNo → {Topic, AssignmentNo}. Similarly, in QNo → {Topic, AssignmentNo},
AssignmentNo is extraneous as QNo+ contains AssignmentNo from F’={
QNo → {Topic}
{ QNo} → QType
}
Question - 4
Consider the relational schema GameRepo (GameName,GameType,Developer,PlayedBy)
with the following Functional Dependency
GameName,GameType → Developer
GameType → PlayedBy
Developer → GameName
a) 4 b) 6 c) 8 d) 10`
Solution - 4
Solution: (b)
Superkeys: {GT, GN}, {GT, GN, P}, {GT, GN, D}, {GT, GN, D, P}
The decomposition is lossless because the common attribute is Colored, which is a key in
Fig2. The decomposition is not dependency preserving as Dimensions → FNo cannot be
preserved from the decomposition.
Question - 6
Consider the relational schema GameRepo (GameName,GameType,Developer,PlayedBy)
with the following Functional Dependency
GameName,GameType → Developer
GameType → PlayedBy
Developer → GameName
Identify the number of candidate keys and the highest normal form of Fig.
Solution - 7
Solution: Fig has 3 candidate keys and is in 3NF
Candidate keys: {Page, FNo},{Page, Colored}, {Page, Dimensions}
Prime attributes: {Page, FNo, Colored, Dimensions}
1NF: Yes
2NF: Since all attributes are prime, there is no non-prime attribute that is determined by a
proper subset of a candidate key.
3NF: Since all attributes are prime, the RHS will always be the part of some key.
BCNF: In FD2 and FD3, the LHS is not a super key.
Question - 8
Consider the instance of the relation Food (DishName, Price, Restaurant). Which of the
following Functional Dependencies hold true on Food as can be found in the given
instance?
a) {DishName, Price}
b) {Restaurant, Price}
c) {Restaurant, DishName}
Option (b) cannot be a candidate key as the tuple {250, ItaliYum} corresponds to both
MudCake and Risotto. Option (d) is incorrect as it is a superkey.
Question - 10
Consider the following relation: ClothesShop(ClothType, CColor, Designer, ShopID) with the
following functional dependencies:
FD1: ClothType → CColor
FD2: {Designer, CColor} → ShopID
According to the rule of pseudo-transitivity, which of the following functional dependencies can
be derived?
a) CColor → ShopID b) {ClothType, CColor} → ShopID
c) {ClothType, Designer} → ShopID d) ClothType → ShopID
Solution - 10
Solution: (c) {ClothType, Designer} → ShopID
If X→Y
and YZ → W
then, XZ → W
1NF: Yes
Proper subset of candidate key determines a non-prime attribute. Hence not in 2NF.
Question - 14
Solution - 14
Question - 15
Solution - 15
Solution: (d)
Question - 16
Solution - 16
Question - 17
Solution - 17
Question - 18
Solution - 18
Solution: 1NF
1NF: Yes
Author → Category
ISBN → Pages
ISBN → Publisher
Question - 19
Solution - 19
Solution: 2NF
1NF: Yes
2NF: No non-prime attribute is determined by a proper subset of a candidate key.
3NF: Table → Price does not satisfy any of the following conditions
a.RHS should be a subset of LHS
b.LHS is a superkey
c.RHS is part of some key