Question: Recall the simple Beers database ( used in the SQL queries videos ) and some ( approximate ) table definitions from that database: create table
Recall the simple Beers database used in the SQL queries videos and some approximate table definitions from that database:
create table Beers name text primary key, brewer text ;
create table Drinkers name text primary key, address text, phone text ;
create table Likes drinker text references Drinkersname
beer text references Beersname
primary key drinker beer;
Which of the following queries maybe more than one answers the question "Which drinkers like every beer?"
Note that there may be no drinkers that satisfy this property in the original instance of the database.
a
select dname
from Drinkers d
where not exists
select Lbeer as name from Likes L where Ldrinker dname
except
select name from Beers
;
b
select dname
from Drinkers d
where not exists
select name from Beers
except
select Lbeer as name from Likes L where Ldrinker dname
;
c
select dname
from Drinkers d
where select count from Beers
select countLbeer from Likes L where Ldrinker dname;
d
select dname
from Drinkers d
where exists
select Lbeer as name from Likes L where Ldrinker dname
except
select name from Beers
;
e
None of above options is correct
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
