Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Question, write SQL queries to answer the questions. Find all films with maximum length or minimum rental duration (compared to all other films). In

SQL Question, write SQL queries to answer the questions.

  1. Find all films with maximum length or minimum rental duration (compared to all other films).

    In other words let L be the maximum film length, and let R be the minimum rental duration in the table film. You need to find all films that have length L or duration R or both length L and duration R.

    If a film has either a maximum length OR a minimal rental duration it should appear in the result set. It does not need to have both the maximum length and the minimum duration.

    You just need to return the film_id for this query.

    Order your results by film_id in ascending order.

  2. We want to find out how many of each category of film ED CHASE has starred in.

    So return a table with category_name and the count of the number_of_films that ED was in that category.

    Your query should return every category even if ED has been in no films in that category

    Order by the category name in ascending order.

  3. Find the first_name, last_name and total_combined_film_length of Sci-Fi films for every actor.

    That is the result should list the names of all of the actors(even if an actor has not been in any Sci-Fi films) and the total length of Sci-Fi films they have been in.

    Look at the category table to figure out how to filter data for Sci-Fi films.

    Order your results by the actor_id in descending order

image text in transcribed

film film_id title description release_year language_id original_language_i rental_duration rental_rate length replacement_cost category category_id name last_update language language_id name last_update film_category film_id category_id last_update actor actor_id first_name last_name last_update actor id last_update film_id film_actor

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

Step: 3

blur-text-image

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions