DBMS previous ques
DBMS previous ques
l3ke,8,4 (psr48,4> © (Planets) 4.450000) } 4) {pl3lp, $0000} (
€ Planets ‘ p>50000)}
Answer: b)
Explanation: Options (a) and (d) are ruled ont as <> axe not present. Option (e) is syntac-
tically incorrect (Refer to slide 12.28). Option (b) is syntactically and semantically correct6
Question 7
Consider the following scenario:
A Natural resource management company keeps a recond of different forests, identified by their
names. A forest is associated with its location thal contains the Country and area in which the
[orest is present, In cach forest, there are different types of trees that are also recorded by the
‘company.
‘Which of the following sehema correctly represents the Forest entity set? Marks: 2 MCQ
4) Forest (lane, Location, Trees)
>) Forest (ame, Country, Area), Forest.trees (ane, Tres
)
©) Forest (Wiane, Trees), Forest Location (liane, Location, Country, Area)
@) Forest (ane, Country, Area), Forest trees (lane, Trees)
Answer: b)
Explanation: Refer to slide 14.28 for details
In the schema of option (a), the location is not properly explained.
In the schema of option (c), the attribute Name cannot be primary key in the Forest relation,
In the schema of option ((), the attribute Naxe eannot be primary key in the Forest. tre
relation,
‘The schema in option (b) specifies the location correctly and eaptures the tree information in
a forest-as well,
Hence, option (b) is correctQuestion 8
Consider the following Entity Relationship Diagram:
Book $2 Author
|Auth_pub
Publisher
Which of the following is (are) true? Marks: 2 MCQ
4) Participation of Author in Auth. pub is total
\) Participation of Publisher in Auth pub is total
6) A Book can be written by multiple Authors.
4) An Author can be associated with at most one Book.
Answer: b)
Explanatios
‘One Author m
One Author may be related to zero or more Publisher. So, the participation of Author in
‘the relation Auth_pub is partial
A Publisher may have one or mote Authors, So, the pact
relation Auth pub is total,
Hence, option (b) is cotrect
According to the syntax of Crows feet notation, the following can be concluded.
write many Books.
ation of Publisher in the
Question 9
Consider the instance of the relational schema Gallery(PaintingID, Artist, Theme) andPrice(PaintingID, Cost):
Gallery Price
PaintingiD | Artist | Theme | | PaineingID | Cost
742 ‘T.Ray | Landscape ‘aia | 124000
aisT J.Ray | Portrait aisr— | 239876
BS Katier | Abstract, Bs | 1000000
2a | Littouston | Landacape 23__| s0000
How many tuples will be generated by the following Tuple Relational Caleulus expression?
{UlSp € Gallery =9 € Price(t[PaintingID) = pPaintingID] A [artist] = plartist] a
plane) \ ([Cest] — g[Coet] / p/Paintingi0] — q/PaintingID))}
Marks: 2 MCQ
a3
wa
8
@ 10
Answer: b)
Explanation: According to slide 12.33, the given Tuple Relational Caleulus expression is
equivalent to
Gallery * Price in Relational Algenra,
Hence, option (b) is correct
Question 10
Consider the instance of the relational schema Gallery (PaintingID, Artist, Theme):
Gallery
PaintingID | Artist
7 Thay
ater J.Ray | Portrait
Ra Katia? | Abstract23 | Lilouston | Landecape
Which of the following Relational Algebra expressions produce(s) exactly the same tuples as
present in this instance of GalLery? ‘Marks: 2 MSQ.
®) TipaintingID, Artist Gallery) ¥ Mpaint ingID, Thene(allery)
») Tipaintingto artist Gallery) # Threat, thene(Gallery)
© Tipasnt ingiD, Thene(Gal0r7) » TlpaintingID, Thene( Gallery)
@) paint ingiD, Thane Artiat (Gal2¢ry) * Tpyene (Gallery)
Answer: a), d)
Explanation: Option (c) is incorrect as Artist will uot be present in the output. Option (b)
Js incorrect as it produces ? extsa tuples due to the redundant value J. Ray in the common
attribute.
Options (a) and (d) ate correct.
10
Database Management System: Assignment 4
‘etal Maks: 20
June 20, 2022
Question 1Consider a relational schema OalineClass(class1D, classLink, Subject, Mentor, Duration)
Which of the following set of functional dependencies should be chosen so that OnlineClaas
can be in 2NF but not in 3NF? ‘Marks: 2MCQ
a) classID + {classLink Subject}
classLink + Duration
Mentor > Subject
) {claseID,claseLink} + {Subject ,Mentor Duration}
{Mentor Subject} + (claseLink,Duration,claselD)
€) {claseID,Mentor} — {classLink,Subject}
classLink + Duration
@) {claseID,claseLink} + {Subject Mentor Duration}
Nentor > claseLink
Answer: ©)
Explanation: For option (b), the candidates keys are {class1D, classLink}, {Mextor,
Subject} which are present on the L.H.S of hath the finetional dependencies. Ths, it makes
OnLineClaas to stay in BCNF,
For option (a), the candidate key is {claseID, Mentor}. Since partial dependency is present
in the FD set, it allows alineClass to be in INF.
For option (d), the candidate keys are (clasaID, claseLink}, {classID, Mentor}. Hence,
there is neither any partial dependeney nor any transitive dependency as the RLS of the
second FD contains a key atteibute, Hence, tis in SNF.
In option (¢), the candidate key is {class1D, Mentor} There is no partial dependeney and
there is a transitive dependency. ‘Thus, option (¢) is correct
Question 2
‘The following dependencies hold ina relation Placement (JoBID ,Company, Position, Salary)
JobID > Conpany
[Position, Company} > Salary
According to which of the following rules, {JobID, Position} + Salary holds?
Marks:
McQ
8) Decomposition
1b) Augmentation
6) Paendorteanstivity
4) Trasitivity
Answer: ¢)
Explanation: According to Pseudo-transitivity rile, if x determines ¥ and ¥2 determines
then XZ determines ¥, Hence, option (c) is correct.Question 3
Consider the following instance of Market relation:
Warket
MarketName | Product | Stock |
Spendviee Shampoo | 12
SpendWise | Spicesiz [6
Spendiise Cookies | 6
ShopLuck ‘Shampoo | 20
WarkIe Cakonix | 60
MarkIe Chocolate | 12
Which of the following funetional dependencies hold on Market? Marks: 2MCQ
a) MarketNane + {Product, Stock}
) (Stock, Markettiane) + Product
©) {Product} + Marketiiame
) (Marketliane, Product} > Stock
Answer: d)
Explanation: Only for option (i), the attributes on the LHS
attributes on the RH.S, Hence, option (d) is correct,
S can uniquely identify theQuestion 4
Consider the following relation:
Measurenent (censor, device, dataform, uprange, lovrange, delay, status)
with the following functional dependency set (F):
FDL: {sensor, device, status} +> {dataform, uprange, lovrange}
#02: seneor “> {delay, status}
FDS; {status, delay, datafora} + {sensor, device}
Measurement has 3 candidate keys. Keys KL, K2, and K3 have 2, 2, and 3 attributes re-
spectively. The database admin issnes the following order
A needs to be appended to the R.H.S of FD& so that only K3 and (K1M.K2) become the ean.
dlidate keys of Measurement, Find & aud 4, Marks: 2MCQ
a)
vice, iat
b) Xedelay, ist
©) Nedataform, i=2
4) Aeetatue, &
‘The 8 candidate keys of Measurement are
levice, sensor}
ldataform, sensor}
Jdataforn, delay, status}
KIN K2 =sensor
For sensor to be the candidate key, elther device or dataforn needs to be appended to
the R.HLS of FD2. Hence, option (c} is correct,Question 5
Consider the following relation:
Measurement (sensor, device, dataform, uprange, lovrange, delay, status)
With the following functional dependency set. (F):
{eensor, device, status} + {dataform, uprange, lovrange}
sensor “+ (delay, atatu}
{evatue, delay, datafors} + (sensor, device}
Which of the following funetional dependencies will not be preseut in the C
F after the application of Union Rule on the final functional dependencies?
meal Cover of
Marks: 2MICQ
a) {eensor, device, status) + {datafora, uprange, losrange}
d) sensor -> {delay, status)
©) {evatua, delay, dataform) + (sensor, device)
4) (sensor, device) > (dataform, uprange, lowrange
Answer: a)
Explanation: We can see that the closure of (sensor, device) still
‘Thus, status is extrancous in the first FD (L-H.S). No other attribute can be removed from
any other FD after removing status, Thus, {sensor, device, status} — {dataform,
‘upranga, lowrange) will not be present in the Canonical cover of F. Hence, option (a) is
neludes atatueQuestion 6
In a relation Weather (Country, City, Dayle, Tinelir, ProbRain, ProbWind, ProbTemp)
[country Csty, Dayllo} uniquely identifies the (ProbRain, ProbWind, ProbTeap). Tamelir
is identified by Dayo. Country is determined by {ProbRain, ProbTemp}, What are the non-
prime attributes of Weather? Marks: 2MCQ
8) Both City & Dayo
) Both Countey & ProbTenp
©) Both Probiind & Timer
4) Both ProbRain & Probisnd
Answer: ¢)
Explanation: According to the problem, the following FDs bold
{Country, City, Daylio} + {ProbRain, ProbWind, ProbTeap}
Daylfo > Tinelir
{Probaain, ProbTesp) + Country
‘The candidate keys are (City, Daylio, Country} and (City, Dayllo, ProbRain, ProbTesp}
Hence, option (c) is correct.6
Question 7
In a selation Weather (Country, City, DayWo, Timelir, ProbRain, Problind, ProbTesp)
(Country, City, Daylio} uniquely identifies the (ProbRain, ProbWind, ProbTeap). Timelir
is identified by Dayle. Country is determined by {ProbRain, ProbTemp}. If Veather has 1o
‘be normalized to 2NF. which of the attributes will be present in both the decompositions of
Weather? Marks: 2 MCQ
8) Country
by) Time
6) ProbRain
4) Daytio
Answer: d)
Explanation: The FD that causes the violation of 2NF is DayNo > Timelir, Hence, one
of the decompositions should be Weather (Dayo, Tinelir). For the decompesitions to be
lossless, the common attribute should be a superkey in atleast one of the decompositions.
In Weather DayWo, Timelir), the FD Daytio —> Tinelir holds and Daytio is the candidate
key. Hence, the other decomposed relation should be Weather2(Country, City, Dayle,
ProbRain, ProbWind, ProbTemp). Thus, option (¢) is correctQuestion 8
Consider the following relation VehService (Vehicle, Golor, Capacity, Wheels, Owner)
‘with the following fuetional dependency sets:
{Vehicle, Color} + Capacity
eels + {Venicle, Capacity, Owner)
FDI: Vehicle -+ [Color, Capacity}
¥D2: Wheele + (Vehicle, Gener)
‘Which of the following statements is true? Maris: 2 MCQ
1) Neither $1 covers $2 nor $2 covers Si
1) $2 covers $1 but $1 does not cover $2
©) 81 covers $2 butt $2 does not cover $1
4) Both 81 covers $2 and 82 covers St
‘The FD Vehicle + (Color, Capacity) of $2 cammot be derived from $2
fas (Vehicle) * dots not contain {Color, Capacity} in $1. All FDs of 81 can be derived
from $2. Hence, option ()) is correctQuestion 9
Consider the relation PollutionControl (PolType, Cause, Severity, Effect, Measure,
TargetZone) with the following functional dependencies:
FDI: PolType + Cause
¥D2: Severity + Effect
¥D3: {PolType, Measure) + TargetZone
¥D4; {Cause, Effect} + {Neasure, Severity}
‘Which of the following options is true?
8) PoLtutionControt has 1 candidate key and is in INF.
}) PoLlutionControl has 2 candidate keys and isin INP.
©) PoliutsonControl has I candidate key and isin 2NP.
4) PoLlutionControl has 2 candidate keys and isin 2NF.
Answer: b)
-e partial dependeney occurs in FDA, itis in INF.
Hence, option (b) is correct
Question 10
Marks: 2 MCQ
‘The candidate keys of PollutionControl are {PolType, Severity} & {PolType,PollutionControl (PolType, Cause, Severity, Effect, Measure, TargetZone) with the
following functional dependencies:
FOL: PolTypa + Cause
FD2; Saverity + Effact
F038; {PolType, Measure) + TargetZone
¥o4: (Cause, Effect} + (Neasure, Severity}
‘The relation is decompased into the following
PollutionControlt (PolType, Cause, Severity, Effect)
PollutionControl2 (PolType, Severity, Measure, TargetZone)
Which of the following is true about the decomposition? Marks: 2 MCQ
2) Both loses and dependency preserving
1) Neither lastess nor dependency preserving
6) Lossless but nat dependency preserving
4) Lossy but dependeney preserving.
Answer: ©)
Explanation: The union of attributes of PollutionControlt and PollutionControl2
encompass all the attributes of PollutionCoxtrel. The common attribute between the to
dlecomposed relations are PolType, Severity which isthe key in PollutienControl1. Hence,
the decomposition is lossless.
Frot PollutionControl i, FDL and FD2 can he derived. FDS can be derived frou PollutionControl2.
However, FD4 cannot be derived from these decompositions, thus making them violate the de-
pendency preserving criteria. Hence, option (c) is correct
10
Database Management System: Assignment 5
Total Maks: 20June 27, 2022
Question 1
Which of the following specifies how an application server communicates with the external
web? ‘Marks: 2 MCQ
a) HTP
by sMerP
6) Web browser
a) car
Answer: «)
Explanation: Common Gateway Interface is a standard interface between the web and ap-
pli
(Refer to Lecture-21),
So, option (4) is correct.
Question 2
ently the incorrect statements) from the following? Marks: 2MSQ
a) Javascript and AJAX technology are used to design server-side applications.
1) Serviet runs inside application servers
6) 308 connections always stay connected
4) Java Server Page is platform independent
Javascript and AJAX technology are used to design client-side applications
‘and JDBC connections stay connected until the elient disconnects,Hence, options a) and c) are the answer.
Question 3
What will be the availability of the Redundant Arrays of Independent Disks (RAID) system, if
the Mean Time Between Failure (MTBF) is 25 days and the Mean Time To Repair (ATTR)
the system is 18 hours?
Marks:2 MCQ
a) 97.091
») 96.02%
6) 58.14%
4) 30.25%
Answer: a)
Explanation: Mean tize between failures is the average time between failures,
‘Mean time between failures (MTBF) = total available tine / number of failures.
Mean time to repair is the average time taken to repair the system.
‘Mean time to repair(MTTR)= total vnavailable time /nnmaber of failures
Availablity = Total available time /(total available time -+total unavailable time)AUDLEY (0) = TTBS TR
ian,
AST % = 97.09%
Hence, option a) is correct,
Question 4
Suppose there is a 256 gigabyte flash storage system, with 4 kilobyte page size. The adelress
of each page is stored In the memory as an array called a fash translation table. If the size of
‘the flash translation table is 512 megabytes, what is the maximum address size of a page?
Marks: 2MCQ
2) 8 bytes
b) 10 bytes
6) 82 bytes
4) 64 bytes
No. of flash pages
Suppose, ench address requires p byes
‘Therefore, the lash translation table would be = p x 64 x 10
So, p = isthe = 8 bytes
256 gigabyte _ 256 x 10
Apatiesyte = axaQuestion 5
enti the correct statemes
(s) about the following RAID levels?
Marks: 2 MSQ
48) RAID 0 provides byte-level striping with mirvoring
1) RAID 4 provides disk mizvoring without steiping.
«) RAID 8 provides hyte-level striping with dedicated parity checking
4) RAID 5 provides Byte-level striping without paeity bits
Answer: b), 6)
Explanation: RAID 0 provides block-level striping without parity or mirroring and RAID S
provides block-level striping with distributed parity. Therefore, these two statements are given
in options a) and d) are incorrect.
Hence, options b) and ¢) are the answers.Question 6
Suppose, there is @ 512 gigabyte magnetic disk with 256 sufaces and 1024 tracks per surface
It has 512 sectors in each track, what will be the size of one sector?
Marks: 2MCQ
a) 512 bytes
>) LKB
9) 2B
4) 4KB
Answer: d)
Explanation: Capacity of a magnetic disk
per surface x Number of sectors per track x Number of bytes per sector
So, the size of a sector
Capacity of a magnetic disk
‘Total munber of surfaces x Number of tracks
or bytes
2 pyces
So, the number of bytes per sector
2! bytes6
Question 7
‘Which of the following layer is wot present in a typical 3-tier Mobile Application architecture?
Marks: 2MCQ
8) Application layer
) Presentation layer
©) Business layer
4) Data layer
A typical 3-tier Mobile Application Architecture consist: Presentation layer
Business layer
Data layer
Hence, opt
ma) is the answerQuestion 8
Consider a database management system that organizes its records ofa file in sequential order
and one block contains only whole records. A file containing faculty records has 824 records
‘and each record is 40 bytes long. Ifthe disk block size is I kilobyte, and the block pointer size
is 8 bytes, how many blocks will be required to store the faculty file?
Marks: 2 MEQ
a)
vp 32
©) 8
aa
Answer: ¢)
Explanation: One block can store only whole recor
So, one block can store n mmimbers of whole recoeds and one black pointer.
One record size = 40 bytes
Disk block Sze = 1024 bytes
Disk block pointer = 8 bytes
Actual storage size of one block = (1024 - 8) = 1016 bytes
n= 12/40 = 25.8 ~ 25
So, maximum of 25 records can he stored in a block
‘There are 824 records in the fle, hence the required number of blocks = 824 / 25 = 38Question 9
In aDrawing Competition, participants individually cau euzoll tele names for the competi-
ton. There ate many groups in te competition depending on the age of the particépants, A
participant can participate in only one group and a group consists of multiple participants.
Each group has a unique name (GName) and a participant also has a unique id. The result,
(score) of each group is maintained separately. Which of the following statement(s) are incor-
rect? Marks: 2MSQ.
1) Entity Group does not have any primary key
) Participate is a one-to-many relationship between Group and Participants,
©) Participate isa many-to-many relationship between Group and Participant.
4) GNane may be the foreign key of Participate relation between Group and Participant.
Answer: a), ©)
Explanation: If we draw the ER diagram of it, we can see there will be 0
relationship between Group and Participant.
Gname isthe primary key of the entity Group table, Hence, can be te foreign key of Participate
relation between Group auc Partiespant.
Comme >
[sou LL —