Workspace
Victoria Miller/

Most Profitable Broadway Shows Christmas

0
Beta
Spinner
Unknown integration
DataFrameavailable as
df
variable
SELECT e.eventname, SUM(l.numtickets) AS total_tickets_sold, SUM(s.qtysold) AS total_tickets_purchased, AVG(l.priceperticket) AS average_ticket_price, SUM(l.totalprice) AS total_revenue
FROM public.users u
JOIN public.sales s ON u.userid = s.buyerid
JOIN public.listing l ON s.listid = l.listid
JOIN public.event e ON l.eventid = e.eventid
JOIN public.date d ON e.dateid = d.dateid
JOIN public.venue ON e.venueid = venue.venueid
WHERE d.holiday = 'True' AND d.month = 'DEC' AND venue.venuestate = 'NY' AND venue.venuecity = 'New York City'
GROUP BY e.eventname
ORDER BY SUM(l.totalprice) DESC, SUM(s.qtysold) DESC, AVG(l.priceperticket) DESC;
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
  • AI Chat
  • Code