Skip to content
Menu
academicscog
  • Home
  • How it Works
  • Order Now
  • Sign up
academicscog

4.9 LAB – Nested aggregates – MIN of COUNT (Sakila) Refer to the film and invent

Posted on January 21, 2023

4.9 LAB – Nested aggregates – MIN of COUNT (Sakila)
Refer to the film and inventory tables of the Sakila database. The tables in this lab have the same columns and data types but fewer rows.
Write a query that lists the titles of films with the fewest rows in the inventory table.
This query requires a subquery that computes the minimum of counts by film_id:
SELECT MIN(count_film_id)
FROM ( SELECT COUNT(film_id) AS count_film_id
FROM inventory
GROUP BY film_id )
AS temp_table;
This subquery is provided in the template.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

©2023 academicscog | Powered by WordPress and Superb Themes!