Performed PostgreSQL analysis to uncover genre distribution and country-level trends in Netflix content.

This Project involves a comprehensive analysis of Netflix’s movies and TV Shows data using SQL. The is to extract various valuable insights and answers various business questions based on the dataset. The following README provides a detailed of the project’s objectives, business problems, solutions.
The data for the project is sourced from the Kaggle dataset - Movies Dataset
Download - netflix_csv
Create Table netflix
(
show_id Varchar(6),
type Varchar(10),
title Varchar(150),
director Varchar(250),
casts Varchar(1000),
country Varchar(150),
date_added Varchar(150),
release_year INT,
rating Varchar(250),
duration Varchar(250),
listed_in Varchar(100),
description Varchar(250)
)
Select
type,
Count(*)
From netflix
Group By type
Select
type,
rating
From
(
Select
type,
rating,
Count(*) as total_content,
Rank() Over(Partition By type order By Count(*) Desc) as ranking
From netflix
Group By 1,2
--Order By 1,3 Desc
) As t1
Where ranking = 1
Select
*
From netflix
Where type= 'Movie'
And
release_year = 2020
Select
unnest(String_To_Array(country,',')) as new_country,
count(show_id) as total_content
From netflix
Group By 1
Order By 2 Desc
Limit 5
Select *
From netflix
Where type = 'Movie'
And
duration = (select max(duration) From netflix)
Select *
From netflix
Where
To_date(date_added, 'Month DD, YYYY') >= Current_Date - Interval '5 Year'
Select *
From netflix
Where director ILIKE '%Rajiv Chilaka%'
Select *
From netflix
Where type = 'TV Show'
And
Split_Part(duration, ' ' , 1) :: numeric>5
Select
Unnest(String_to_Array(listed_in, ',')) as genre,
count(show_id) as total_content
From netflix
Group By 1
Order By 2 Desc
Select *
From netflix
Where listed_in ILIKE '%documentaries%'
Select *
From netflix
Where director IS NULL
Select *
From netflix
Where
casts ILIKE '%Salman Khan%'
And
release_year > Extract(year From Current_date) - 10
Select
Unnest(String_to_Array(Casts,',')) as actors,
Count(show_id) as total_content
From netflix
Where country ILIKE '%India%'
Group By 1
Order By 2 DESC
LIMIT 10
With new_table
AS
(Select *,
Case
When
description ILIKE '%Kill%'
Or description ILIKE '%Violence%'
Then 'Bad content'
Else 'Good Content'
End category
From netflix)
Select
category,
count(*) as total_content
From new_table
Group By 1