Question: 3 . 1 0 LAB - Multiple joins with aggregate ( Sakila ) types but fewer rows. The tables are initialized with LOAD rather than

3.10 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
(3) History Tutorial
Initialize.sql }\times\mathrm{ Main.sql }\times\mathrm{ film_actor.csv }\times\mathrm{ film.csv }
1}\mathrm{ SELECT
actor.last_name, actor.first_name,
ROUND(AVG(film.length),0) AS 'average'
FROM actor
INNER JOIN film_actor ON actor,actor_id = film_actor,actor_id
INNER JOIN film ON film_actor,film_id = film,film_id
GROUP BY actor,actor_id, actor.last_name, actor,first_name
HAVING COUNT(film.film_id)>0
ORDER BY average DESC, actor.last_name ASC;
I am still receiving error with code error 1146 table zybooks.actor doesnt exist . What am i doung wrong with he code?
3 . 1 0 LAB - Multiple joins with aggregate (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!