Answered You can hire a professional tutor to get the answer.

QUESTION

Write Answer for the question on page 4.

Write Answer for the question on page 4.

For each of the questions below, (i) construct a single SQL query, and (ii) provide the answer to the question by using MySQL Workbench to run each query (that is, the results returned after executing SQL statements in MySQL Workbench). Some of the questions can be answered by querying one table; others will require joining multiple tables to get the answer.

1.      What are the titles and lengths for films rated R and longer than 180 minutes (excluding 180 minutes)?

(Hint: R-rated movies have rating value equal to 'R')

Display: movie title and length

2.      What is the average replacement cost for each movie rating (i.e., G, PG, PG-13, R, NC-17)?

Display: rating and average replacement cost

3.      How many PG-rated movies mention 'documentary' in their description?

(Hint #1: PG-rated movies have rating value equal to 'PG';

Hint #2: use WHERE...LIKE.... Remember, LIKE '%dog%' will match any value containing "dog," LIKE '%dog' will any value ending in "dog," and LIKE 'dog%' will match any value beginning in "dog.")

Display: number of movies

4.      What are the three most popular last names among the actors in the database (assume no ties)?

Display: last name and how many times that name appears in the actor table

5.      For different film ratings (i.e., G, PG, R, NC-17), which film rating has the lowest

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question