From the course: SQL: Data Reporting and Analysis
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Challenge: Cost analysis - SQL Tutorial
From the course: SQL: Data Reporting and Analysis
Challenge: Cost analysis
(energetic music) - [Instructor] Imagine now that you work in a central administrative function for this movie rental empire that's represented by the Sakila database. You are an analyst advising the finance and strategy departments on things like which movies are becoming obsolete and trends in which movies are becoming more or less popular, or trends in which movies are more or less cost-effective to buy. And that one is the purpose of this challenge. You've been asked to analyze your movie data by rating, such as G or PG, as we saw before. You want to know whether certain ratings have a cheaper replacement cost than others. But you are only interested in cheap movies, those with an average cost of less than 20, that are relatively short as well, 90 minutes or less. And you want to know how many you have of each rating in this category. Stop this movie now if you want to try this query with no further input…