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
--Wrap these in "\COPY (<query>) TO file.csv WITH CSV" to export
--Overall sales/day:
select orders.order_date, sum(bills.total) as daily_total from bills inner join orders on bills.oid = orders.oid group by orders.order_date order by orders.order_date;
--Sum of items sold per day by item (needs pivot in excel):
select distinct item_name, sum(quantity) as units_sold, order_date from ordermenuitems inner join orders on ordermenuitems.oid = orders.oid group by item_name, order_date order by order_date;