TASK 6 Multi-table queries with JOINs Flashcards

1
Q

Find the domestic and international sales for each movie

A

SELECT title, domestic_sales, international_sales
FROM movies
JOIN boxoffice
ON movies.id = boxoffice.movie_id;

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

Show the sales numbers for each movie that did better internationally rather than domestically

A

SELECT title, domestic_sales, international_sales
FROM movies
JOIN boxoffice
ON movies.id = boxoffice.movie_id
WHERE international_sales > domestic_sales;

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

List all the movies by their ratings in descending order

A

SELECT title, rating
FROM movies
JOIN boxoffice
ON movies.id = boxoffice.movie_id
ORDER BY rating DESC;

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