Question: Consider the following relation schemas. The primary keys are underlined. All attributes are of type string if not indicated otherwise. Use multi-step and multi-line queries

Consider the following relation schemas. The primary keys are underlined. All attributes are of type string if not indicated otherwise. Use multi-step and multi-line queries to ease the formulation of queries. Use the rename operator to give intermediate query results a name (some textbooks use the equivalent notation). Aggregate functions as you can find them defined in some textbooks are not allowed, neither in homework assignments nor in exams. [Note: If the location of your answer for a question is not correctly specified in Gradescope, one point will be deducted.]

Theaters(tID, name, location) Auditoriums(tID, aID, number of seats: integer)

Movies(mID, title, running time: integer, genre, director, release date:integer)

Booking(tID, aID, cID, mID, bID, seat number, date:integer, year:integer, time:integer)

Customers(cID, name, street, city) Comments:

The attribute date:integer has the format 0101...1231.

The attribute time:integer has the format 0000...2359.

(a) [5 points] Find the names of customers who have booked the movie ABC more than once on the same day. (ABC is a movie title and unique.)

(b) [5 points] Find the names of customers who have watched the movie directed by Bong and the movies running time is the shortest among his movies.

(c) [5 points] Find the names of customers who always watch movies in the morning.

(d) [5 points] Find the titles of the movies along with their directors that have been shown in all theaters in Gainesville. Assume that all movies in all theaters were booked at least once.

(e) [5 points] Find the names of customers who never booked a movie in 2022.

in relational algebra only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!