-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetflix Data Analytics
31 lines (26 loc) · 1.21 KB
/
Netflix Data Analytics
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
-- In this SQL code, I'm querying a database holding data about Netflix releases to find various answers about the data.
-- join the tables together to show some basic info
SELECT people.show_id, people.director, titles.title, titles.type
FROM "CharlotteChaze/BreakIntoTech"."netflix_people" people
JOIN "CharlotteChaze/BreakIntoTech"."netflix_titles_info" titles
ON people."show_id" = titles."show_id"
LIMIT 5;
-- how many movie titles are there in the database?
SELECT Count(*)
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info"
WHERE type = 'Movie';
-- when was the most recent batch of tv shows and/or movies added to the database?
SELECT MAX("release_year")
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info";
-- who was the director for the movie Bright Star?
SELECT people.director
FROM "CharlotteChaze/BreakIntoTech"."netflix_people" people
JOIN "CharlotteChaze/BreakIntoTech"."netflix_titles_info" titles
ON people."show_id" = titles."show_id"
WHERE titles.title = 'Bright Star';
-- what is the oldest movie in the database and what year was it made?
SELECT title, release_year
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info"
WHERE type = 'Movie'
ORDER BY release_year ASC
LIMIT 1;