{"id":29916610,"url":"https://github.com/jotstolu/netflix-sql-data-analysis-project","last_synced_at":"2025-08-02T05:03:11.540Z","repository":{"id":305277760,"uuid":"1022455367","full_name":"jotstolu/Netflix-SQL-Data-Analysis-Project","owner":"jotstolu","description":"This project explores the Netflix dataset using SQL queries to uncover trends, patterns, and business insights that could help stakeholders understand content distribution, viewer preferences, and platform optimization","archived":false,"fork":false,"pushed_at":"2025-07-19T07:01:22.000Z","size":624,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-19T10:37:58.407Z","etag":null,"topics":["data-analysis","sql","sql-server","tsql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jotstolu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-19T05:36:50.000Z","updated_at":"2025-07-19T07:01:26.000Z","dependencies_parsed_at":"2025-07-19T10:38:05.018Z","dependency_job_id":"5f8d8178-031e-471c-ba94-0c44aec5afa7","html_url":"https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project","commit_stats":null,"previous_names":["jotstolu/netflix-sql-data-analysis-project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jotstolu/Netflix-SQL-Data-Analysis-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotstolu%2FNetflix-SQL-Data-Analysis-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotstolu%2FNetflix-SQL-Data-Analysis-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotstolu%2FNetflix-SQL-Data-Analysis-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotstolu%2FNetflix-SQL-Data-Analysis-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jotstolu","download_url":"https://codeload.github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jotstolu%2FNetflix-SQL-Data-Analysis-Project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268337936,"owners_count":24234538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","sql","sql-server","tsql"],"created_at":"2025-08-02T05:01:10.595Z","updated_at":"2025-08-02T05:03:11.531Z","avatar_url":"https://github.com/jotstolu.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 Netflix SQL Data Analysis Project\n\nThis project explores the **Netflix dataset** using **SQL queries** to uncover trends, patterns, and business insights that could help stakeholders understand content distribution, viewer preferences, and platform optimization.\n\n## 📊 Project Objective\n\nThe goal is to answer key business questions such as:\n- What is the ratio of movies to TV shows?\n- Which countries and genres dominate Netflix's catalog?\n- Who are the most featured actors or directors?\n- How has Netflix’s content evolved in recent years?\n\n## 🧰 Tools \u0026 Technologies\n\n- **SQL Server / T-SQL**\n- **Netflix dataset** (in `.csv` format)\n\n## 🔍 Business Questions Answered\n\n1. **Count the Number of Movies vs TV Shows**\n2. **Find the Most Common Rating for Movies and TV Shows**\n3. **List All Movies Released in the Year 2021**\n4. **Top 5 Countries with the Most Content on Netflix**\n5. **Identify the Longest Movie**\n6. **Find Content Added in the Last 5 Years**\n7. **Find All Movies/TV Shows by Director 'Rajiv Chilaka'**\n8. **List All TV Shows with More Than 5 Seasons**\n9. **Count the Number of Content Items in Each Genre**\n10. **Average Yearly Content Released in India**\n11. **List All Movies that are Documentaries**\n12. **Find All Content Without a Director**\n13. **Find How Many Movies Actor 'Salman Khan' Appeared in the Last 10 Years**\n14. **Top 10 Actors with Most Movies Produced in India**\n15. **Categorize Content Based on the Presence of 'Kill' and 'Violence' Keywords**\n\n## SQL Queries\n\n**1. Count the Number of Movies vs TV Shows**\n```sql\nSELECT type, COUNT(type) AS total_count\nFROM netflix_tb\nGROUP BY type;\n```\n![number_of_movies](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/1.%20Count%20the%20Number%20of%20Movies%20vs%20TV%20Shows.png?raw=true)\n\n**2. Most Common Rating for Movies and TV Shows**\n```sql\nWITH common_rating AS (\n    SELECT type, rating, COUNT(*) AS total_count,\n           RANK() OVER (PARTITION BY type ORDER BY COUNT(*) DESC) AS rank\n    FROM netflix_tb\n    GROUP BY type, rating\n)\nSELECT type, rating, total_count FROM common_rating WHERE rank = 1;\n```\n![most_common_rating](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/2.%20Find%20the%20Most%20Common%20Rating%20for%20Movies%20and%20TV%20Shows.png?raw=true)\n\n\n**3. All Movies Released in 2021**\n```sql\nSELECT title, type, release_year\nFROM netflix_tb\nWHERE type = 'Movie' AND release_year = 2021;\n```\n![movies_released](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/3.%20List%20All%20Movies%20released%20in%20year%202021.png?raw=true)\n\n \n**4. Top 5 Countries with the Most Content**\n```sql\nSELECT TOP (5) TRIM(value) AS country, COUNT(*) AS count\nFROM netflix_tb\nCROSS APPLY STRING_SPLIT(country, ',')\nGROUP BY TRIM(value)\nORDER BY count DESC;\n```\n![Top_5_countries](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/4.%20Find%20the%20Top%205%20Countries%20with%20the%20Most%20Content%20on%20Netflix.png?raw=true)\n\n**5. Identify the Longest Movie**\n```sql\nSELECT title, duration\nFROM netflix_tb\nWHERE type = 'Movie'\n  AND duration = (SELECT MAX(duration) FROM netflix_tb);\n```\n![longest_movie](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/5.%20Identify%20the%20Longest%20Movie.png?raw=true)\n\n**6. Content Added in the Last 5 Years**\n```sql\nSELECT title, date_added\nFROM netflix_tb\nWHERE date_added \u003e= DATEADD(YEAR, -5, GETDATE());\n```\n![longest_movie](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/6.Find%20Content%20Added%20in%20the%20Last%205%20Years.png?raw=true)\n\n**7. Movies/TV Shows by Director 'Rajiv Chilaka**\n```sql\nSELECT type, title, director\nFROM netflix_tb\nWHERE director LIKE '%Rajiv Chilaka%';\n```\n![Movies/TV](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/7.%20Find%20All%20MoviesTV%20Shows%20by%20Director%20'Rajiv%20Chilaka'.png?raw=true)\n\n\n**8. TV Shows with More Than 5 Seasons**\n```sql\nSELECT title, type, duration\nFROM netflix_tb\nWHERE type = 'TV Show' AND duration \u003e '5 Seasons';\n```\n![TV Shows](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/8.%20List%20All%20TV%20Shows%20with%20More%20Than%205%20Seasons.png?raw=true)\n\n\n**9. Number of Content Items per Genre**\n```sql\nSELECT TRIM(value) AS genre, COUNT(*) AS total_content\nFROM netflix_tb\nCROSS APPLY STRING_SPLIT(listed_in, ',')\nGROUP BY TRIM(value)\nORDER BY COUNT(*) DESC;\n```\n![number_of_content](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/9.%20Count%20the%20Number%20of%20Content%20Items%20in%20Each%20Genre.png?raw=true)\n\n**10. Average Yearly Content Released in India**\n```sql\nSELECT \n    YEAR(date_added) AS year,\n    COUNT(*) AS total_content,\n    ROUND(\n        CAST(COUNT(*) AS NUMERIC) * 100.0 / \n        CAST((SELECT COUNT(*) FROM netflix_tb WHERE country = 'India') AS NUMERIC),\n        2\n    ) AS avg_content_year\nFROM netflix_tb\nWHERE country = 'India'\nGROUP BY YEAR(date_added)\nORDER BY COUNT(*) DESC;\n```\n![Average_year](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/10.Find%20each%20year%20and%20the%20average%20numbers%20of%20content%20release%20in%20India%20on%20netflix..png?raw=true)\n\n **11. All Movies that are Documentaries**\n```sql\nSELECT title, type, listed_in\nFROM netflix_tb\nWHERE type = 'Movie' AND listed_in LIKE '%Documentaries%';\n```\n![Documentaries](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/11.%20List%20All%20Movies%20that%20are%20Documentaries.png?raw=true)\n\n**12. All Content Without a Director**\n```sql\nSELECT type, director\nFROM netflix_tb\nWHERE director IS NULL;\n```\n![content_without_director](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/12.%20Find%20All%20Content%20Without%20a%20Director.png?raw=true)\n\n**13. Movies Featuring 'Salman Khan' in Last 10 Years**\n```sql\nSELECT cast, title, release_year\nFROM netflix_tb\nWHERE cast LIKE '%Salman Khan%'\n  AND release_year \u003e YEAR(GETDATE()) - 10;\n```\n![Movies Featuring 'Salman Khan'](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/13.%20Find%20How%20Many%20Movies%20Actor%20'Salman%20Khan'%20Appeared%20in%20the%20Last%2010%20Years.png?raw=true)\n\n**14. Top 10 Actors in Indian Movies**\n\n```sql\nSELECT TOP 10 \n    TRIM(value) AS actor,\n    COUNT(*) AS appearances\nFROM netflix_tb\nCROSS APPLY STRING_SPLIT(cast, ',')\nWHERE country = 'India' AND cast IS NOT NULL\nGROUP BY TRIM(value)\nORDER BY COUNT(*) DESC;\n```\n![Top 10 Actors in Indian Movies](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/14.%20Find%20the%20Top%2010%20Actors%20Who%20Have%20Appeared%20in%20the%20Highest%20Number%20of%20Movies%20Produced%20in%20India.png?raw=true)\n\n**15. Content Categorized by 'Kill' or 'Violence' Keywords**\n\n```sql\nSELECT category, COUNT(*) AS content_count\nFROM (\n    SELECT \n        CASE \n            WHEN description LIKE '%kill%' OR description LIKE '%violence%' THEN 'Bad'\n            ELSE 'Good'\n        END AS category\n    FROM netflix_tb\n) AS categorized_content\nGROUP BY category;\n```\n![Content Categorized](https://github.com/jotstolu/Netflix-SQL-Data-Analysis-Project/blob/main/assets/img/15.%20Categorize%20Content%20Based%20on%20the%20Presence%20of%20'Kill'%20and%20'Violence'%20Keywords.png?raw=true)\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotstolu%2Fnetflix-sql-data-analysis-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjotstolu%2Fnetflix-sql-data-analysis-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjotstolu%2Fnetflix-sql-data-analysis-project/lists"}