{"id":24263886,"url":"https://github.com/27ahmad/netflix_sql_project","last_synced_at":"2026-02-03T19:02:50.005Z","repository":{"id":259706556,"uuid":"879246231","full_name":"27ahmad/Netflix_SQL_Project","owner":"27ahmad","description":"The Netflix SQL Project analyzes the Netflix dataset using SQL queries to gain insights into its content, identify trends, and address business problems related to movies and TV shows.","archived":false,"fork":false,"pushed_at":"2024-10-27T12:18:44.000Z","size":1577,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T13:55:01.154Z","etag":null,"topics":["data-analysis","postgresql-database","sql"],"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/27ahmad.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}},"created_at":"2024-10-27T12:04:24.000Z","updated_at":"2024-10-27T12:20:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7ccd1f2-4f41-4166-bc86-90ee64e4e496","html_url":"https://github.com/27ahmad/Netflix_SQL_Project","commit_stats":null,"previous_names":["27ahmad/netflix_sql_project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/27ahmad/Netflix_SQL_Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/27ahmad%2FNetflix_SQL_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/27ahmad%2FNetflix_SQL_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/27ahmad%2FNetflix_SQL_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/27ahmad%2FNetflix_SQL_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/27ahmad","download_url":"https://codeload.github.com/27ahmad/Netflix_SQL_Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/27ahmad%2FNetflix_SQL_Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29054047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","postgresql-database","sql"],"created_at":"2025-01-15T08:52:56.886Z","updated_at":"2026-02-03T19:02:49.987Z","avatar_url":"https://github.com/27ahmad.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Netflix SQL Project\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/0/08/Netflix_2015_logo.svg\" alt=\"Netflix Logo\" width=\"300\"/\u003e\n\n## About This Project\n\nThe **Netflix SQL Project** is an analytical exploration of the Netflix dataset using SQL queries. The primary goal of this project is to derive insights into the content available on Netflix, identify trends, and solve various business problems related to movies and TV shows.\n\n### Key Features:\n\n- **Data Analysis**: Perform comprehensive analysis on the Netflix dataset to uncover interesting insights.\n- **Business Questions**: Address 15 different business problems using SQL, such as:\n  - Counting the number of movies and TV shows.\n  - Identifying the most common ratings for different types of content.\n  - Listing all movies released in a specific year.\n  - Finding the top countries with the most content.\n  - Analyzing content trends over the years.\n- **Table Creation**: Create a well-structured `netflix` table to store essential information, including titles, directors, cast, country, release year, and descriptions.\n- **Advanced Queries**: Utilize advanced SQL features like window functions, string manipulation, and aggregate functions to derive insights.\n\n### Technologies Used:\n\n- **SQL**: For querying and analyzing data.\n- **PostgreSQL**: As the database management system (DBMS) for storing and manipulating the dataset.\n\n### Dataset:\n\nThe dataset used in this project is a mockup representing Netflix's library, containing various details about movies and TV shows.\n\n## Project Structure\n\n1. **Table Creation** - Define the `netflix` table with columns to store information on Netflix content, including titles, type, director, casts, country, release year, rating, and more.\n2. **SQL Queries** - Solve various business problems and extract insights using SQL queries.\n\n## Table Schema\n\nThe `netflix` table has the following structure:\n\n```sql\nCREATE TABLE netflix\n(\n    show_id VARCHAR(6),\n    type VARCHAR(10),\n    title VARCHAR(150),\n    director VARCHAR(208),\n    casts VARCHAR(1000),\n    country VARCHAR(150),\n    date_added VARCHAR(50),\n    release_year INT,\n    rating VARCHAR(10),\n    duration VARCHAR(15),\n    listed_in VARCHAR(100),\n    description VARCHAR(250)\n);\n```\n\n## Example Queries\n\nHere are some example queries used to analyze the Netflix data:\n\n- **View All Content**:\n  ```sql\n  SELECT * FROM netflix;\n  ```\n\n- **Count Total Content**:\n  ```sql\n  SELECT COUNT(*) AS total_count FROM netflix;\n  ```\n\n- **Distinct Types of Content**:\n  ```sql\n  SELECT DISTINCT type FROM netflix;\n  ```\n\n## Business Problems Addressed\n\n### 1. Count the Number of Movies vs. TV Shows\n```sql\nSELECT \n    type,\n    COUNT(*) AS total_content\nFROM netflix\nGROUP BY type;\n```\n\n### 2. Find the Most Common Rating for Movies and TV Shows\n```sql\nSELECT \n    type,\n    rating\nFROM\n(\n    SELECT\n        type,\n        rating,\n        COUNT(*),\n        RANK() OVER (PARTITION BY type ORDER BY COUNT(*) DESC) AS ranking\n    FROM netflix\n    GROUP BY 1, 2\n) AS t1\nWHERE ranking = 1;\n```\n\n### 3. List All Movies Released in 2020\n```sql\nSELECT * FROM netflix\nWHERE type = 'Movie' AND release_year = 2020;\n```\n\n### 4. Find the Top 5 Countries with the Most Content on Netflix\n```sql\nSELECT\n    UNNEST(STRING_TO_ARRAY(country, ',')) AS new_country,\n    COUNT(*) AS total_content\nFROM netflix\nGROUP BY 1\nORDER BY 2 DESC\nLIMIT 5;\n```\n\n### 5. Find the Top 5 Longest Movies\n```sql\nSELECT \n    title,  \n    SUBSTRING(duration, 1, POSITION('m' IN duration) - 1)::int AS duration\nFROM netflix\nWHERE type = 'Movie' AND duration IS NOT NULL\nORDER BY duration DESC\nLIMIT 5;\n```\n\n### Additional Queries\n\nThis project also addresses 10 more business-related questions, such as identifying content added in the last 5 years, finding TV shows with more than 5 seasons, and categorizing content based on keywords in descriptions.\n\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or additional queries, feel free to open an issue or submit a pull request.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F27ahmad%2Fnetflix_sql_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F27ahmad%2Fnetflix_sql_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F27ahmad%2Fnetflix_sql_project/lists"}