Task 12 Order of execution of a Query Flashcards

1
Q

Find the number of movies each director has directed

A

SELECT director, COUNT(id) as Num_movies_directed
FROM movies
GROUP BY director;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Find the total domestic and international sales that can be attributed to each director

A

SELECT director, SUM(domestic_sales + international_sales) as Cumulative_sales_from_all_movies
FROM movies
INNER JOIN boxoffice
ON movies.id = boxoffice.movie_id
GROUP BY director;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly