IMDb Dataset Analysis | Python, MySQL

For this project, I worked with the official IMDb public datasets and used both Python and SQL to clean, explore, and analyze large-scale entertainment data. The main goal of this project was to understand how real-world raw data can be transformed into a structured and reliable dataset, and then used to answer meaningful business and content-related questions.
This project started with data cleaning in Python using pandas, and then moved into analytical queries in both Python and SQL. Since IMDb data comes in raw TSV files with multi-valued columns, missing values, and complex relationships between tables, this project gave me hands-on experience with both data preparation and deeper analysis.
Dataset overview
I used multiple IMDb datasets, each representing a different part of the movie and TV ecosystem. These included title metadata, ratings, people information, cast and crew details, episode-level data, and alternate titles across regions and languages.
The main datasets I worked with were:
people.tsv (rename from name.basics.tsv) for actor, actress, writer, and director information
titles.tsv (rename from title.basics.tsv ) for core movie and TV title details
title_ratings.tsv (rename from title.ratings.tsv) for ratings and vote counts
title_episode.tsv (rename from title.episode.tsv)for TV episode relationships
title_principals.tsv (rename from title.principal.tsv) for cast and principal crew
title_crew.tsv (rename from title.crew.tsv) for directors and writers
title_alternates.tsv (rename from title.akas.tsv) for alternate title names across countries and languages
This structure made the project feel very close to real-world relational data analysis.
Data cleaning and preparation
The first phase of the project focused on cleaning the raw IMDb files. Since the source data contained missing values marked as \N, null-like text values, and multi-valued columns, I had to make the data usable before doing any real analysis.
In the people dataset, I removed records with missing names, checked for invalid birth and death year combinations, and handled possible duplicate people based on name and birth year. I also converted fields like professions and known titles into list format so that they could be processed more easily.
For title-related datasets, I checked for duplicates, removed rows with missing title identifiers, and validated join keys to maintain referential integrity across the files. This was important because most of the analysis depended on joining titles, ratings, episodes, people, and crew data together correctly.
This part of the project helped me understand that good analysis starts with clean and trustworthy data.
Foundational analysis
After cleaning, I moved into basic exploratory analysis using Python and SQL.
I started by filtering and listing movies released between 2010 and 2015. Then I looked at how many titles existed for each title type, which gave a quick overview of the dataset composition. I also identified the highest-rated titles with at least 50,000 votes, which helped balance popularity and quality together.
Another useful analysis was identifying titles with no rating information available. This was a simple but realistic data-quality type of question, and it showed how left joins and null checks can help find missing relationships between datasets.
For TV series, I calculated the total number of episodes per series and listed the series with the highest episode counts. On the people side, I filtered actors and actresses to prepare for appearance-based analysis.
These were foundational queries, but they helped build a strong understanding of the dataset before moving to more advanced work.
Intermediate analysis
In the next stage, I focused on ranking, grouping, and multi-table analysis.
One of the interesting tasks was ranking the top 10 titles per decade for each title type using average rating, with vote count as a tie-breaker. In Python, I used sorting and groupby with cumulative counting to mimic SQL-style ranking logic. In SQL, I used window functions like ROW_NUMBER() to do the same more directly.
I also analyzed which movies and TV series had the widest international reach by measuring how many alternate regional or language-specific titles they had. This gave a different view of content performance — not by rating, but by global availability and localization.
Another major part of this stage was actor-director collaboration analysis. I created actor-director pairs by combining title principals and crew data, then joined ratings to measure how successful those collaborations were. Instead of using simple averages, I used weighted ratings based on vote counts, which made the results more realistic.
This stage pushed the project beyond descriptive analysis and more into content intelligence and performance comparison.
Advanced analysis
The advanced part of the project focused more on patterns, anomalies, and career-based insights.
One analysis I found especially interesting was breakout performance detection for actors and actresses. For each person, I built a timeline of their titles and calculated rolling baselines using their previous work. Then I identified titles where audience votes increased sharply while ratings stayed strong. This helped highlight the first project where an actor’s popularity significantly jumped compared to their earlier work.
I also worked on episode continuity validation for TV series. Using season and episode data, I identified missing episode numbers, invalid values, and gaps in sequence. This kind of analysis is useful because it mixes data quality checks with content structure analysis.
Another advanced task was identifying “single-author” titles — titles where at least one person was both writer and director. I then compared how common these titles were across genres and title types, and how successful they were based on vote-weighted ratings. This added a creative and business angle to the analysis by exploring whether tighter creative control had any visible audience impact.
I also analyzed genre popularity by decade using audience votes and ratings, and looked at the top actors and actresses by total audience reach. To go further, I classified them as either specialists or crossover performers depending on whether one genre dominated most of their audience votes.
These analyses made the project much richer because they were not just about finding totals or counts — they were about understanding trends, shifts, and relationships inside the data.
Using both Python and SQL
A key part of this project is that I did not stop at Python analysis only. I also translated several parts of the logic into SQL, especially in MySQL.
This helped me practice the same analytical thinking in two different ways. In Python, I used pandas for cleaning, joining, exploding multi-valued columns, and performing grouped calculations. In SQL, I worked with CTEs, window functions, recursive logic, aggregations, and joins.
Doing both was valuable because it showed me how the same business question can be solved using different tools depending on the environment. It also made the project stronger from a portfolio point of view because it demonstrates flexibility across both programming and database layers.
What this project shows
This project is a strong example of end-to-end data work. It includes raw file ingestion, cleaning, validation, relational joins, exploratory analysis, ranking, anomaly detection, and advanced performance analysis.
Through this project, I was able to work with:
large raw TSV datasets
messy and missing values
multi-valued columns
multi-table joins
ranking and weighted metrics
time-based and career-based analysis
both Python and SQL implementations
More than anything, this project helped me think more deeply about how to move from raw entertainment data to structured insights.
Final thoughts
This IMDb project is more than a simple movie dataset analysis. It shows how I approach a real dataset step by step — first cleaning it properly, then exploring it, and finally asking more advanced questions that reveal deeper patterns.
For my portfolio, I wanted this project to reflect both technical skill and analytical thinking. It combines Python, SQL, data cleaning, and business-style analysis in one workflow, which makes it one of my most complete projects.





Comments