1.Identify the statements that will be TRUE after executing the following statements on an empty MongoDB collection.
db.fruit.insert([
{_id:501,Fruitname:"Pine apple",Season: "Summer",Price:45),
{_id:502,Fruitname:"Water melon",Season:"Winter", Price:40},
{_id:503,FruitnameCustard apple",Season:"Summer",Price:40},
{_id:504,Fruitname:"Banana",Season: "Winter",Price:25},
{_id:505, Fruitname:"Mosambi",Season: "Winter",Price:25},
{_id:506,Fruitname:"Musk melon",Season:"Summer",Price:35}]);
db.fruit.update({$or:[{Fruitname:"Water melon"},{Price:40}]},{$set:{Price:35}});
db.fruit.update({id:503},{$set:{Price:25}});
db.fruit.update({_id:506),(Season:"Winter"});
db.fruit.remove({Price:{$gt:40}});
Which of the following statement(s) is/are TRUE?
i) Three fruits will have price as 25
ii) The fruit collection will have 4 "Winter" seasons.
iii) Two fruits will have price as 35.
iv) Two fruits will have a name ending with "melon".
a) i and ii
b) i and iii
c) ii and iv
d) i,ii,iii.
(c) is the correct option.
2. Consider relational schema along with the functional dependencies given below:
gaming(gamename,gametype,amount,playerno,playername,playertype,discount,duration)
playerno->playername, playertype,discount
gamename->gametype, duration,amount
playertype->discount
How many tables will result when the relation is in 3NF?
a) 1
b) 2
c) 3
d) 4
(c) is the correct option.
3.Consider a Patient table with attributes patientid
(primary key), patientname, city, dateofbirth and phone.
Except patientid no columns are unique. The table has three
indexes as follows:
IDX1 - patientid
IDX2-patientname,dateofbirth
IDX3-dateofbirth,phone
Which of the following queries will result in INDEX UNIQUE SCAN?
a) WHERE city > Mumbai' AND dateofbirth > '30-Mar-1995'
b) WHERE patientid = 'P1007' AND dateofbirth = '30-Mar-1995'
c) WHERE patientname = 'Sam' AND dateofbirth = '30-Mar-1995’
d) WHERE patientname LIKE 'R%
(c) is the correct option.
4.Consider the table stores and sales given below:
Which of the following is suitable primary key for the following?