Question: 4 . 7 LAB - Nested aggregates ( Sakila ) Refer to the film and inventory tables of the Sakila database. The tables in this
LAB Nested aggregates 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 filmid:
SELECT MIN countfilmid
FROM SELECT COUNTfilmid AS countfilmid
FROM inventory
GROUP BY filmid
As temptable;
This subquery is provided in the template.
qxzqy
LAB
: LAB Nested aggregates Sakila
Main.sql
Load default template...
SELECT MINcountfilmid FROM
SELECT COUNT filmid AS countfilmid
FROM inventory
GROUP BY filmid
AS temptable ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
