-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNETFLIX_PROJECT.sql
More file actions
61 lines (51 loc) · 1.61 KB
/
NETFLIX_PROJECT.sql
File metadata and controls
61 lines (51 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---Netflix Project---
-- importing the dataset
select * from dbo.netflix_titles
--1. count the number of movies vs tv shows
select
type,
count(*) as totalcontent
from dbo.netflix_titles
group by type
--2. Find the most common rating for movies and tv shows
select rating,
count(*) as commonrating
from dbo.netflix_titles
group by rating
--3. List all movies released in a specific year (2020)
select title
from dbo.netflix_titles
where type = 'movie' and
release_year= '2020'
--4. Find the top 5 countries with the most content on netflix
select TOP 5 country,
count(title)
from dbo.netflix_titles
group by country
order by count(title) desc
--5. select the longest movie
select * from dbo.netflix_titles
where type = 'movie'
and duration = (select max(duration) from dbo.netflix_titles)
--6. Select all the movies/tv show by director 'rajiv chilaka'
select
* from dbo.netflix_titles
where director like '%rajiv chilaka%'
--7. List all tv show with more than 5 seasons
select *,
trim(trailing ' season' from duration) as season
from dbo.netflix_titles
where type= 'tv show'
and trim(trailing ' season' from duration) > 5
--8. Find all the content withou a director
select * from dbo.netflix_titles where director is null
--9. find the movies actor is 'salman khan'
select * from dbo.netflix_titles where cast like '%salman khan%'
--15. Categorize Content Based on the Presence of 'Kill' and 'Violence' Keywords
select *,
case
when description like '%kills%' or
description like '%violence%' then 'bad_content'
else 'good_content'
end category
from dbo.netflix_titles