Skip to content

About

SQL analysis of Netflix's content catalog using PostgreSQL — exploring ratings, genres, runtime, and cast/crew trends across a two-table relational schema (5,850 titles, 77,800+ credits).

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Netflix Titles & Credits SQL Analysis

Overview

A SQL analysis of Netflix's content catalog, covering titles (movies and TV shows) and their associated cast/crew credits. The goal was to uncover trends in ratings, genres, runtime, certifications, and cast/crew contributions using PostgreSQL across two related tables.

Dataset

  • Source: Netflix TV Shows and Movies dataset (Kaggle)
  • titles table: 5,850 rows — id, title, type, description, release_year, age_certification, runtime, genres, production_countries, seasons, imdb_id, imdb_score, imdb_votes, tmdb_popularity, tmdb_score
  • credits table: 77,801 rows — person_id, id, name, character, role

Tools

  • PostgreSQL (via pgAdmin 4)
  • SQL (aggregation, grouping, multi-table joins, HAVING clauses, ranking logic)

Key Queries & What They Answer

  • Top/bottom 10 movies and shows by IMDB score
  • Average IMDB and TMDB scores by content type, age certification, and production country
  • Content volume by decade and by release year
  • Most common age certifications for movies
  • Top 20 actors and directors by number of appearances
  • Average runtime: Movies vs. TV Shows
  • Directors of movies released 2010+, and of high-IMDB/high-popularity movies (joins across both tables)
  • Shows with the most seasons
  • Most common genres for movies and for shows
  • Actors who played the same character across multiple titles
  • Average IMDB score per actor (3+ titles, to avoid one-hit skew)

Key Findings

  • TV Shows outscore Movies on average — average IMDB score for Shows is 6.98 vs. 6.25 for Movies (TMDB: 7.48 vs. 6.46), suggesting Netflix's original/curated show library is generally better received than its movie catalog.
  • The 2010s dominate the library — 3,304 titles were released in the 2010s alone (vs. 1,972 so far in the 2020s and just 369 in the 2000s), showing a sharp acceleration in content acquisition starting around 2010.
  • Comedy is the top movie genre — 384 movies are tagged comedy, ahead of documentation (230) and drama (224); for shows, reality leads at 113, followed by drama (104) and comedy (100).
  • R is the most common movie certification — 556 movies are rated R, ahead of PG-13 (451), PG (233), G (124), and NC-17 (16). Despite being the most common, R-rated movies have a lower average IMDB score (6.29) than TV-14 content (7.22), the highest-scoring certification band.
  • Movies run roughly 2.5x longer than shows per entry — average runtime is 98.2 minutes for movies vs. 38.98 minutes per episode for shows.
  • Boman Irani and Kareena Kapoor Khan are tied for most on-screen appearances at 25 titles each, followed by Shah Rukh Khan (23) — reflecting the dataset's strong representation of Indian film/TV content.
  • Akari Kito has the highest average IMDB score among actors with 3+ titles (8.60 across 3 titles), narrowly ahead of Choi Young-jun (8.57) and Adivi Sesh (8.55, across 4 titles).

Files

  • setup_tables.sql — schema and table creation for titles and credits
  • Netflix_SQL_Analysis.sql — all analysis queries with comments
  • titles.csv, credits.csv — source dataset (or link to Kaggle source if not included in repo)

Notes

This project focuses on demonstrating SQL proficiency across a realistic two-table schema: aggregation, multi-table joins on a shared title ID, HAVING clauses for post-aggregation filtering, and ranking/filtering logic — not just basic single-table queries.

About

SQL analysis of Netflix's content catalog using PostgreSQL — exploring ratings, genres, runtime, and cast/crew trends across a two-table relational schema (5,850 titles, 77,800+ credits).

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors