Write a SQL query that analyses the film languages: How many films are mentioned
ID: 3642488 • Letter: W
Question
Write a SQL query that analyses the film languages: How many films are mentioned in the FilmDB per language and what is the average film length per each language? Note: Your query should consider both English films and foreign language films (films where the original_language attribute is set). Show in your result each language (by name), the number of movies in each language and the average length of films of this language. List the result so that the languages with the highest average film length come first before 'shorter languages'.
Output should look like this:
Explanation / Answer
SELECT B.name as language name , COUNT(film_id) as number of films , AVG(length) as average film length FROM Film A, Language B WHERE A.language_id=B.language_id GROUP BY B.name ORDER BY AVG(length) desc
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.