Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

=+and non-compete agreements in three to five different countries.

Answered: 1 week ago