Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Scenarios 1) The low level data model of the Beer database is provided below: DATABASE: BAR (Bar_name[pk], City, Phone, Owner_SSN[pk,fk]) BEER (Beer_name[pk], Type, Country, Proof)

Scenarios 1) The low level data model of the Beer database is provided below: DATABASE: BAR (Bar_name[pk], City, Phone, Owner_SSN[pk,fk]) BEER (Beer_name[pk], Type, Country, Proof) CUST (SSN[pk], Name, Birth_year, Fav_beer[fk], Gender) LIKES (SSN[pk,fk], Beer[pk,fk]) SERVES (Bar[fk], Beer[fk]) OWNER (SSN[pk], Name, City, Address, Phone)

For this database, all the tables are created and populated in a dump file that you can download it from here. This part must be done individually and NOT in groups. You need to import the dump file to your MySQL as a new database (instructions on how to import a database can be found in page 10 of MySQL tutorial) and then perform the following queries: List the beers served by at least one bar and liked by at least one customer. 11) List the SSN, name, address, and phone number of all owners who do not serve Coors in their bars. 12) List SSN of the customers who like the same beer. The list should be in form of pairs of SSNs. That is, the SSNs of two persons who like the same beer. 13) Find total number of bars that serve Coors. 14) Find the total number of beers that are liked by customers. Note that if a beer is repeatedly liked by several people, it is just counted as once. 15) An active bar is defined as a bar that serves more than 3 beers (beer names/brands). List the name of active bars. That is, for the bars that serve more than three beers (i.e., the diversity is three or more), list the bar names and the number beers each one of the bars serves. Show the results in the descending order of number of beers.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions