Starting from:
$30

$24

Homework #2 Solution

Instructions - same as before - submit sql query and result in any format as long as it readable. Best – sql query, followed by the result in text file.


Queries [DO NOT USE AGGREGATES LIKE COUNT etc in any of the queries], feel free to use outer joins.

1)Drinkers who do not like any beer

2) Bars which serve no beer(s) which Joe likes (you can use one of the outer joins if you want)

3) Beers which are liked by at most one drinker who frequents Cabana

Comment: Beers which are liked by none of the drinkers who frequent Cabana should be included. This is the meaning of “at most”

4) Drinkers who frequent no bars that Tom frequents


5) Bars which serve all beers that Cabana serves and possibly more

6) Pairs of drinkers who frequent the same bar (and possibly other bars)

Comment: Order pairs so you do not return <Bob, Ann, <Ann, Bob





More products