Question: 8. [4 points] Write a query that lists the theater name, phone and the number of movies played by the theaters in The U District

 8. [4 points] Write a query that lists the theater name,
8. [4 points] Write a query that lists the theater name, phone and the number of movies played by the theaters in The U District district, where each theater plays less than 3 movies. The theatres must be sorted in descending order by the number of movies shown by each theater. Each of them should play at least 1 movie.
9. [3 points] Write a query that lists the theater name, phone, address, and district name of theaters playing Meet the Parents or any NR-rated movie.
10. [4 points] Write a query that lists all theaters name, movie name, movie rating, movie length, and phones numbers sorted in ascending order in DOWNTOWN district that play the longest PG-13-rated movie or the shortest R-rated-movie.
11. [3 points] Write a query that lists the average length of movies played in Boeing Imax Theater.
12. [3 points] Write a query that lists the district names that the theater "General Cinema Pacific Place 11" belongs to. Note that a theater may belong to multiple districts.
13. [5 points] : Write a query that lists the name(s) of the theater(s) that belong(s) to at least two districts and play(s) any "R"-Rated Movie.

Consider a database with the following schema: 1. The movies table stores the movies played in theaters throughout the city. 2. The districts table stores the city districts where the movie theaters are located. 3. The theaters table stores movie theaters. 4. The movies2theaters table stores the movies and the corresponding theaters that play that movie. 5. The theaters2districts table lists the theaters and their districts; note that some theaters belong to several districts. Tables like movies2theaters and theaters2districts are sometimes called "junction" tables. They store foreign keys from main tables and connect them in this way. Junction tables are not usually meant to store any additional data/objects. Before you start answering the questions, it is helpful to understand the schema and browse the data. You could start by issuing a few trivial select * queries from tables in the schema (e.g. SELECT FROM movies;). You can use your home folder as temporary storage for your queries and result listings

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!