Question: 3 . 1 0 LAB - Multiple joins with aggregate ( Sakila ) types but fewer rows. The tables are initialized with LOAD rather than
LAB Multiple joins with aggregate Sakila
types but fewer rows. The tables are initialized with LOAD rather than INSERT, statements. The LOAD statements read data from. csy
files. In these files, N represents NuLL.
Write a statement that:
Computes the average length of all films that each actor appears in
Rounds average length to the nearest minute and renames the result column average.
Displays last name, first name, and average, in that order, for each actor.
Sorts the result in descending order by average, then ascending order by last name.
The statement should exclude films with no actors and actors that do not appear in films.
Hint: Use the Round and AVG functions.
Run
History Tutorial
Initialize.sql timesmathrm Main.sql timesmathrm filmactor.csv timesmathrm film.csv
mathrm SELECT
actor.lastname, actor.firstname,
ROUNDAVGfilmlength AS 'average'
FROM actor
INNER JOIN filmactor ON actor,actorid filmactor,actorid
INNER JOIN film ON filmactor,filmid film,filmid
GROUP BY actor,actorid actor.lastname, actor,firstname
HAVING COUNTfilmfilmid
ORDER BY average DESC, actor.lastname ASC;
I am still receiving error with code error table zybooks.actor doesnt exist What am i doung wrong with he code?
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
