Path: blob/master/Exercises_2.ipynb
145 views
Exercises
The Sakila Database
One of the best example databases out there is the Sakila Database, which was originally created by MySQL and has been open sourced under the terms of the BSD License.
The Sakila database is a nicely normalised schema modelling a DVD rental store, featuring things like films, actors, film-actor relationships, and a central inventory table that connects films, stores, and rentals.
Hands on!
What's the mean of film_rental_duration
?
What's the most common rental duration?
Show a bar plot with all the durations.
What is the most common rental rate?
Show a pie plot with all possible rental rates.
Show a bar plot with all possible rental rates.
Which plot you think fits the best in this case? Why?
How is the replacement cost distributed?
Show a box plot of the replacement costs.
Show a density plot of the replacement costs.
Add a red line on the mean.
Add a green line on the median median.
How many films of each rating do we have?
Show the raw count of each film rating.
Show a bar plot with all possible film ratings.
### Does the film replacement cost vary depending on film rating?
In the United States, film classification is a voluntary process with the ratings issued by the Motion Picture Association of America (MPAA) via the Classification and Rating Administration (CARA).
G (General Audiences): All Ages are Admitted.
PG (Parental Guidance Suggested): Some Material May Not Be Suitable for Children.
PG-13 (Parents Strongly Cautioned): Some Material May Be Inappropriate for Children Under 13.
R (Restricted): Under 17 Requires Accompanying Parent or Adult Guardian.
NC-17 (Adults Only): No One 17 and Under Admitted.
Show a grouped box plot per film rating with the film replacement costs.
Add and calculate a new rental_days
column
This numeric column should have the count of days between rental_date
and return_date
.
Analyze the distribution of rental_days
Calculate the mean of
rental_days
.Show a density (KDE) of
rental_days
.
### Add and calculate a new film_daily_rental_rate
column
This value should be the division of film_rental_rate
by film_rental_duration
.
Analyze the distribution of film_daily_rental_rate
Calculate the mean of
film_daily_rental_rate
.Show a density (KDE) of
film_daily_rental_rate
.
List 10 films with the lowest daily rental rate
List 10 films with the highest daily rental rate
How many rentals were made in Lethbridge city?
How many rentals of each film rating were made in Lethbridge city?
Show a bar plot with each film rating count.