-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlbolt_platform.sql
More file actions
24 lines (20 loc) · 1.15 KB
/
Copy pathsqlbolt_platform.sql
File metadata and controls
24 lines (20 loc) · 1.15 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
List all movies that were released on even number years
SELECT title, year FROM movies
WHERE year % 2 = 0;
---------------------------------------------------------------------------------------------------------------------------------------
Find the total number of years employed by all Engineers
SELECT role, SUM(years_employed) FROM employees
GROUP BY role
HAVING role = "Engineer";
---------------------------------------------------------------------------------------------------------------------------------------
Find the total domestic and international sales that can be attributed to each director
SELECT director, SUM(Domestic_sales + International_sales) as total_sum FROM movies
JOIN boxoffice
ON movies.id = boxoffice.movie_id
GROUP BY director;
---------------------------------------------------------------------------------------------------------------------------------------
Both the title and director for Toy Story 8 is incorrect! The title should be "Toy Story 3" and it was directed by Lee Unkrich
UPDATE movies
SET title = "Toy Story 3",
director = "Lee Unkrich"
WHERE id = 11;