lerocha/netflixdb

Sample database for MySQL, Oracle, PostgreSQL, SQLite, and SQL Server. Based on data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list, it includes movies and TV shows for learning and practice purposes.

Kotlin

119

189 commits

updated Sep 23, 2026

See the code

README

Netflix Sample Database

Sample database based on the data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list, it includes movies and TV shows for learning and practice purposes.

Supported Database Servers

  • MySQL
  • Oracle
  • PostgreSQL
  • SQLite
  • SQL Server

Download

Download the SQL scripts from the latest release assets. One or more SQL script files are provided for each database vendor supported. You can run these SQL scripts with your preferred database tool.

Data Sources

Data Model

database.png

Sample Queries - Postgres

-- Movies released since 2024-01-01
select id, title, runtime from movie where release_date >= '2024-01-01';
-- TV Show Seasons released since 2024-01-01
select s.id, s.title as season_title, s.season_number, t.title as tv_show, s.runtime
from season s left join tv_show t on t.id = s.tv_show_id
where s.release_date >= '2024-01-01';
-- Top 10 movies (English)
select v.view_rank, m.title, v.hours_viewed, m.runtime, v.views, v.cumulative_weeks_in_top10
from view_summary v
inner join movie m on m.id = v.movie_id
where duration = 'WEEKLY'
  and end_date = '2025-06-29'
  and m.locale = 'en'
order by v.view_rank;
-- Engagement report
select m.title, m.original_title, m.available_globally, m.release_date, v.hours_viewed, m.runtime, v.views
from view_summary v
inner join movie m on m.id = v.movie_id
where duration = 'SEMI_ANNUALLY'
  and start_date = '2024-01-01'
order by v.view_rank asc;

Development

System Requirements

Building and generating the SQL Scripts

Start the database containers:

docker compose up -d

Generate the SQL Scripts:

./build.sh

The generated SQL scripts will be in the build/artifacts folder:

open ./build/artifacts
database
mysql
oracle
postgres
postgresql
sql
sqlserver

Significant stargazers

Jeremy Cook

14 followers · starred Jan 2025

kun321

8 followers · starred Mar 2025

Maz Ameli

55 followers · starred Dec 2025

lerocha/netflixdb

Sample database for MySQL, Oracle, PostgreSQL, SQLite, and SQL Server. Based on data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list, it includes movies and TV shows for learning and practice purposes.

Kotlin

119

189 commits

updated Sep 23, 2026

See the code

README

Netflix Sample Database

Sample database based on the data from the Netflix Engagement Report and the Netflix Global Top 10 weekly list, it includes movies and TV shows for learning and practice purposes.

Supported Database Servers

  • MySQL
  • Oracle
  • PostgreSQL
  • SQLite
  • SQL Server

Download

Download the SQL scripts from the latest release assets. One or more SQL script files are provided for each database vendor supported. You can run these SQL scripts with your preferred database tool.

Data Sources

Data Model

database.png

Sample Queries - Postgres

-- Movies released since 2024-01-01
select id, title, runtime from movie where release_date >= '2024-01-01';
-- TV Show Seasons released since 2024-01-01
select s.id, s.title as season_title, s.season_number, t.title as tv_show, s.runtime
from season s left join tv_show t on t.id = s.tv_show_id
where s.release_date >= '2024-01-01';
-- Top 10 movies (English)
select v.view_rank, m.title, v.hours_viewed, m.runtime, v.views, v.cumulative_weeks_in_top10
from view_summary v
inner join movie m on m.id = v.movie_id
where duration = 'WEEKLY'
  and end_date = '2025-06-29'
  and m.locale = 'en'
order by v.view_rank;
-- Engagement report
select m.title, m.original_title, m.available_globally, m.release_date, v.hours_viewed, m.runtime, v.views
from view_summary v
inner join movie m on m.id = v.movie_id
where duration = 'SEMI_ANNUALLY'
  and start_date = '2024-01-01'
order by v.view_rank asc;

Development

System Requirements

Building and generating the SQL Scripts

Start the database containers:

docker compose up -d

Generate the SQL Scripts:

./build.sh

The generated SQL scripts will be in the build/artifacts folder:

open ./build/artifacts
database
mysql
oracle
postgres
postgresql
sql
sqlserver

Significant stargazers

Jeremy Cook

14 followers · starred Jan 2025

kun321

8 followers · starred Mar 2025

Maz Ameli

55 followers · starred Dec 2025

Languages

Kotlin

99.7%