Skip to content
Datasets / Movie Rentals
Dataset

Movie Rentals SQL Practice Dataset

Movies, customers, and rental history for compact join, aggregate, and NULL practice.

Tables
3
Rows
48
Size
Small
Level
Beginner
Domain
Media
Formats
CSV · SQL

Download this dataset, free

No account, no email, no attribution required: dedicated to the public domain under CC0 1.0, so commercial use and redistribution are fine. Open it in the browser playground, take the single movie_rentals.sql file to load every table into PostgreSQL, MySQL, SQLite, DuckDB, or SQL Server, or grab the raw CSV files below.

movie_rentals.sql All 3 tables, 48 rows, as CREATE TABLE and INSERT statements. Download →

Movie Rentals is a compact three-table dataset for practicing SQL without a large schema getting in the way. The catalog table describes each movie, the customer table identifies renters, and the rental history table links them together with dates and amounts.

Because some rentals have not been returned, the dataset is especially good for practicing IS NULL, left joins, Top-N reports, and grouped revenue summaries.

Schema

How the Movie Rentals tables join moviescustomersrentals movie_idcustomer_idrental_idcustomer_idmovie_id PKPKPKFKFK + 4 more columns+ 4 more columns+ 3 more columns
Arrows point from a column to the key it references. PK marks a table's key and FK a column that references another table.
Join conditions
  • rentals.customer_id = customers.customer_id
  • rentals.movie_id = movies.movie_id
Schema · Movie Rentals View dataset schema 3 tables
Table · movies

One row per movie in the catalog.

5 columns · 12 rows
movie_id int title text genre text release_year int rating decimal
Table · customers

One row per customer.

5 columns · 10 rows
customer_id int first_name text last_name text city text joined_date date
Table · rentals

One row per rental. Movies still out have a null returned_date.

6 columns · 26 rows
rental_id int customer_id int movie_id int rental_date date returned_date date amount decimal

Best for

  • Joining rentals to customers and movies.
  • Counting, ranking, and summing activity by movie or customer.
  • Finding rentals that are still out with IS NULL.

Starter questions

  • Which genres produce the most rental revenue?
  • Which customers have the most rentals?
  • Which movies have not been returned yet?

Practice lessons