James Cameron Movies Sales
Task
Swipe to start coding
James Cameron's movies are very popular, but are they such in each city? Create a list of cities, containing info about sales of James Cameron's movies.
Print records with two columns: city
and sales
(containing the total sales of James Cameron's movies). Order records by city
in lexicographical order.
Solution
9
1
2
3
4
5
6
7
8
select distinct c.city as city, sum(sales) as sales
from schedule as s
inner join movie as m on m.id=s.movie_id
inner join director as d on d.id=m.director_id
inner join cinema as c on c.id=s.cinema_id
where d.full_name='James Cameron'
group by city
order by city
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 2
9
1
No query executed yet... |
Ask AI
Ask anything or try one of the suggested questions to begin our chat