Exploratory Data Analysis on the IMDB dataset using Python, SQL (SQLite), and data visualization libraries.
Data is downloaded automatically via the imdb-sqlite package, which fetches and converts the official IMDB public datasets into a local SQLite database.
- Python 3.11
- pandas — data manipulation
- NumPy — numerical computation
- Matplotlib / Seaborn — visualizations
- scikit-learn (
CountVectorizer) — genre encoding - pycountry — country name resolution
- SQLite3 — SQL queries over the IMDB database
Install dependencies
poetry installActivate the virtual environment
poetry shellDownload and build the IMDB database
poetry run imdb-sqliteThe notebook answers 15 questions through SQL queries and Python visualizations:
| # | Question |
|---|---|
| 1 | What are the most common title categories on IMDB? |
| 2 | What is the percentage of movies per genre? |
| 3 | What is the median rating per genre? |
| 4 | How has the median movie rating changed over the years? |
| 5 | How many movies per genre were released each year? (Top 5 genres) |
| 6 | What is the longest movie? Calculate runtime percentiles. |
| 7 | What is the median runtime per genre? |
| 8 | How many movies were produced per country? |
| 9 | What are the Top 10 best-rated movies? (≥ 25,000 votes) |
| 10 | What are the Top 10 worst-rated movies? (≥ 25,000 votes) |
| 11 | What is the distribution of movie ratings? |
| 12 | What is the relationship between number of votes and rating? |
| 13 | How many movies were released per decade? |
| 14 | What are the Top 10 most voted movies? |
| 15 | Which genres have the highest average rating? |