In this lab, you will be using the Sakila database of movie rentals. You can follow the steps listed here to get the data locally: Sakila sample database - installation.
The database is structured as follows:
- Select all the actors with the first name ‘Scarlett’.
- How many films (movies) are available for rent and how many films have been rented?
- What are the shortest and longest movie duration? Name the values
max_duration
andmin_duration
. - What's the average movie duration expressed in format (hours, minutes)?
- How many distinct (different) actors' last names are there?
- Since how many days has the company been operating (check DATEDIFF() function)?
- Show rental info with additional columns month and weekday. Get 20 results.
- Add an additional column day_type with values 'weekend' and 'workday' depending on the rental day of the week.
- How many rentals were in the last month of activity?
Lab | SQL Queries - Lesson 2.5
- Select all the actors with the first name ‘Scarlett’.
- How many films (movies) are available for rent and how many films have been rented?
- What are the shortest and longest movie duration? Return the results as columns with the names max_duration and min_duration.
- What's the average movie duration expressed in format (hours, minutes) Return the result as columns with the names hours and minutes?
- How many distinct (different) actors' last names are there?
- Since how many days has the company been operating (check the DATEDIFF() function)? Hint: rental table
- Show all rental information with additional columns month and weekday. (hint: DATE_FORMAT() ). Get 20 results.
- Add an additional column day_type with values 'weekend' and 'workday' depending on the rental day of the week.
- How many rentals were made in the last month of renting activity? .... stay tuned, improved instructions for the other labs will maybe follow