Question: 1. For the running example Beers-Bars-Drinkers (with a modification on table Beers to have new schema Beers(name, manf, cost), please write a script file including

1. For the running example Beers-Bars-Drinkers (with a modification on table Beers to have new schema Beers(name, manf, cost), please write a script file including SQL statements to answer the following questions. (To add an attribute to the running example beers table, you can issue the command alter table Beers add column cost real; or you can re-create a new table.) a. Show the beers, their names and their respective minimum prices from table Sells. b. Show bars who sells Bud at cheapest price. c. Show beers and their respective max prices for those beers which are sold in at least 3 bars. (That is, if a beer is sold in 3 or more bars, we want to find its name and max price.) d. Show the beer names and their respective minimum prices for those beers which are sold in both Joes Bar and Sues Bar. e. Find for those beers such that their costs are lower than their respective average sale prices.
Our Running Example All our SQL queries will be based on the following database schema I Underline indicates key attributes. Beers(name, manf) Bars(name, addr, license) Drinkers(name, addr, phone) Likes drinker, beer) Sells(bar, beer, price) Frequents(drinker, bar)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
