YngridFiglioli / lab-sql-2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo_ironhack_blue 7

Lab | SQL Queries 2

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: DB schema



Instructions

  1. Select all the actors with the first name ‘Scarlett’.
  2. Select all the actors with the last name ‘Johansson’.
  3. How many films (movies) are available for rent?
  4. How many films have been rented?
  5. What is the shortest and longest rental period?
  6. What are the shortest and longest movie duration? Name the values max_duration and min_duration.
  7. What's the average movie duration?
  8. What's the average movie duration expressed in format (hours, minutes)?
  9. How many movies longer than 3 hours?
  10. Get the name and email formatted. Example: Mary SMITH - mary.smith@sakilacustomer.org.
  11. What's the length of the longest film title?

About