-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathNetflix Analytics (bit.io)
30 lines (25 loc) · 1.07 KB
/
Netflix Analytics (bit.io)
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
#In this SQL code, I'm querying a database that's holding Nexflix data to answer questions about the data.
#1. How many movie titles are there in the database? (movies only, not tv shows)
select count(*)
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info"
WHERE type='Movie';
#2. When was the most recent batch of tv shows and/or movies added to the database?
select max(date(date_added))
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info";
#3. List all the movies and tv shows in alphabetical order.
select title
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info"
ORDER BY title asc;
#4. Who was the Director for the movie Bright Star?
select
director
FROM "CharlotteChaze/BreakIntoTech"."netflix_titles_info" titles
LEFT JOIN "CharlotteChaze/BreakIntoTech"."netflix_people" people
ON titles.show_id=people.show_id
where titles.title='Bright Star'
#5. 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;