Question: CS 6 3 1 - ASSIGNMENT 4 Due date: See the Assignment page on Canvas Do answer all items below and submit a word /
CS ASSIGNMENT
Due date: See the Assignment page on Canvas
Do answer all items below and submit a wordpdf file via Canvas. If you have a question, email me or ask during class hours. This assignment has two parts; Part I and Part II
PART I points Suppose we have a database consisting of the following three relations
FREQUENTSDRINKER BAR
SERVESBAR BEER
LIKESDRINKER BEER
The first indicates the bars each drinker visits, the second tells what beer each bar serves, the last indicates which beer each drinker likes to drink.
Assume that each drinker likes at least one beer and frequent at least one bar and that a bar serves at least one beer.
Express the queries below in SQL points each
print the bars that serve a beer John Smith likes.
print the drinkers that frequent at least one bar that serve a beer John Smith likes.
print the drinkers that frequent at least one bar that serves a beer they like.
print the drinkers that frequent only bars that serve some beer they like.
print the drinkers that frequent all the bars that serve a beer they like.
print the drinkers that frequent no bar that serves a beer that they like.
print the drinkers that frequent all the bars that serve a beer John Smith likes.
print pairs of drinkers that frequent at least one common bar.
print pairs of drinkers that frequent exactly the same bars.
print the number of beer served per bar.
Which bar is the most popular?
PART II points Consider the following relational database schema:
Movietitle year, length, inColor, studioName, cert#
StarsInmovieTitle movieYear, starName
MovieStarname address, gender, birthdate
MovieExecname address, cert# netWorth
Studioname address, cert# netWorth
Write the following queries in SQL points each
List two stars that share an address.
Query the names and addresses of all female movie stars who are also movie executives with a net worth over $
Query all the titles and years of movies that appeared in either the Movies or StarsIn relations.
Query the producer of Star Wars.
Query all the producers of movies in which LEONARDO DICAPRIO stars.
Query the titles that have been used for two or more movies.
Find sum of the movies length each studio is produced.
Create a list of each producer name and the total length of film produced.
Query the total film length for only those producers who made at least one film prior to
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
