Академический Документы
Профессиональный Документы
Культура Документы
Use the google search bar on side panel. It searches through all previous GATE/other questions.
For hardcopy of previous year questions please see here (https://gateoverflow.in/blog/4490/go-
hardcopy-2019)
GATEBOOK-2019-DBMS1-6 (../272680/gatebook-
2019-dbms1-6)
+3
votes
122 views
Consider the following database schema:
Frequents(kid, store)
Sells(store, candy)
Likes(kid, candy)
A. the kids whose liked candies are not all sold by the 'Starbucks'.
B. the kids whose liked candies are only sold by the 'Starbucks'.
C. the kids whose liked candies are all sold by the store 'Starbucks'.
D. the kids whose liked candies are sold by stores other than 'Starbucks'
(../user/GATEBOOK)
1 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
Answer Comment
1 Answer
+1
vote select candy from sells where store = ‘Starbucks’
Select those kids who do not like candies from 'Starbucks' or those kids who
do not buy any candies from 'Starbucks'.
Select those kids whose all liked candies are sold by the 'Starbucks'.
Option C.
Note -
. B is not the answer because it says only sold by 'Starbucks'. But there is
possibility that some candies which are sold by Satrbucks can also be sold
by different store.
(../user/Shubhgupta)
answered (../272680/gatebook-2019-dbms1-6?show=272958#a272958) Dec 1, 2018 by Shubhgupta
(../user/Shubhgupta) ✔ Loyal (8.4k points)
selected Dec 14, 2018 by Shaik Masthan (../user/Shaik+Masthan)
Comment
but this query will not select those kids whose liked candy is from another
0
store also. So B is wrong because it says only sold by 'Starbucks.'
(../user/Shubhgupta)
commented (../272680/gatebook-2019-dbms1-6?show=278290#c278290) Dec 14, 2018 by Shubhgupta (../user
/Shubhgupta) ✔ Loyal
Reply
0 Mis-understood the options....
2 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
(../user/Shaik+Masthan)
commented (../272680/gatebook-2019-dbms1-6?show=278300#c278300) Dec 14, 2018 by Shaik Masthan (../user
/Shaik+Masthan) ✔ Veteran
Reply
isnot it?
(../user/srestha)
commented (../272680/gatebook-2019-dbms1-6?show=290062#c290062) Jan 6 by srestha (../user/srestha) ✔
Veteran
Reply
yes mam, but i am not getting, what is your doubt regarding this question ?
0
(../user/Shaik+Masthan)
commented (../272680/gatebook-2019-dbms1-6?show=290080#c290080) Jan 6 by Shaik Masthan (../user
/Shaik+Masthan) ✔ Veteran
Reply
In inner query it returns "kid likes candy which sold all other stores other
than starbucks"
Now, outer query returns, "kid likes candy which sold by only starbucks"
(../user/srestha)
commented (../272680/gatebook-2019-dbms1-6?show=290090#c290090) Jan 6 by srestha (../user/srestha) ✔
Veteran
Reply
sells-
STARBUCKS A
CCD B
MCD A
likes-
1 A
2 A
3 B
3 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
(../user/Shubhgupta)
commented (../272680/gatebook-2019-dbms1-6?show=290125#c290125) Jan 6 by Shubhgupta (../user
/Shubhgupta) ✔ Loyal
Reply
Answer: C
Related questions
GATEBOOK-2019-DBMS1-4 +1
The table Arc(x,y) currently has the following tuples (note vote
GATEBOOK-2019-DBMS1-1 +1
Given two relations R1 and R2 , where R1 contains N1 vote
gb2019-dbms1 (../tag/gb2019-dbms1)
4 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
relational-algebra (../tag/relational-algebra)
GATEBOOK-2019-DBMS1-2 0
Suppliers(sid: integer, sname: string, address: string) votes
gb2019-dbms1 (../tag/gb2019-dbms1)
GATEBOOK-2019-DBMS1-3 +1
Suppose that two relations R(A, B) and S(A, B) have vote
gb2019-dbms1 (../tag/gb2019-dbms1)
GATEBOOK-2019-DBMS1-5 +1
The relation R(a, b) may have duplicate tuples. Which of vote
5 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
gb2019-dbms1 (../tag/gb2019-dbms1)
GATEBOOK-2019-DBMS1-7 +4
Consider a relation R(A, B), and the following two votes
gb2019-dbms1 (../tag/gb2019-dbms1)
GATEBOOK-2019-DBMS1-8 +1
Suppose we have a relation declared by: CREATE TABLE vote
gb2019-dbms1 (../tag/gb2019-dbms1)
Custom Search
Search
6 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
Tag Search
Recent Posts
Databases (../databases) 4k
7 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
Projects (../projects) 19
(https://gateoverflow.in/blog/4774/?show=7360#c7360)
(https://gateoverflow.in/blog/7349/?show=7359#c7359)
Thanks all
(https://gateoverflow.in/blog/7349/?show=7359#c7359)
Chat (../chat) Badges (../badges) Search tips (../search-tips) Exam Category (../exam/categories)
(https://www.facebook.com/GATEOverflow)
(https://twitter.com/gateoverflow) (mailto:gatecse@gateoverflow.in)
(https://plus.google.com/+GateoverflowIn)
8 of 9 12/02/19, 10:34 am
GATEBOOK-2019-DBMS1-6 - GATE Overflow https://gateoverflow.in/272680/gatebook-2019-...
GATE Overflow
9 of 9 12/02/19, 10:34 am