I picked up the Netflix Movies and TV Shows dataset from Kaggle to practice SQL beyond just basic SELECT/WHERE queries. The dataset has close to 8,800 titles with details like type, casts, director, country, release year, rating, and genre — but a lot of it is messy (missing directors, inconsistent date formats, multiple values crammed into single columns), which made it a decent dataset to actually practice real data cleaning on, not just querying clean data.
The project goes from setting up the database and table, cleaning the data, and then answering a set of business-style questions using SQL — things like which countries produce the most content, how the catalog has grown over the years, which directors/actors show up most often, and a few more advanced ones using window functions.
- How does the content split between Movies and TV Shows?
- Which countries and genres dominate the catalog?
- How has Netflix's content library grown year over year?
- Are there patterns in ratings, casts size, or genres that say something about content strategy?
- Where are the gaps/issues in the data itself (missing director, missing country, etc.)?
show_id, type, title, director, casts, country, date_added, release_year, rating, duration, listed_in, description
Source: https://www.kaggle.com/datasets/shivamb/netflix-shows
PostgreSQL. Some queries use window functions (LAG, FIRST_VALUE), array/string splitting for the multi-value columns (casts, country, genre), and CASE-based classification.
- date_added isn't in one consistent format — most rows are like 25-Sep-21 but some are like August 4, 2017, so a single TO_DATE format kept throwing errors until I handled both formats.
- cast is a reserved keyword in Postgres, so it needs to be quoted as casts everywhere or the queries fail.
- duration mixes minutes (movies) and seasons (TV shows) in the same column, so it needs to be split logically depending on type before doing anything numeric with it.
- Columns like country, casts, and listed_in hold multiple comma-separated values in a single field, so anything involving "count per country" or "count per genre" needed splitting those out first instead of just grouping by the raw column.
- Around 70% of the catalog is Movies, the rest TV Shows.
- US, India, and UK show up as the top content-producing countries.
- TV-MA and TV-14 are the most common ratings, so the catalog leans toward a more mature audience overall.
- Content additions ramp up noticeably after 2016-17, which lines up with Netflix's big international expansion phase.
- About 30% of rows don't have a director listed — worth keeping in mind if you're doing any director-level analysis on this dataset, since it'll skew results.
https://github.com/TanujRawat28/Netflix_Analysis_SQL_Project/blob/main/Netflix_Analysis_Project.sql - everything: table creation, data cleaning, and all the queries