You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT m.id, m.title, coalesce(sum(r.number_of_tickets), 0) AS sold_tickets
FROM movies AS m
LEFT JOIN reservations AS r
ON m.id = r.movie_id
GROUP BY m.id, m.title
ORDER BY sold_tickets DESC