TABLE is called: Line_items which has the following fields and 3 years of data
order_id (varchar)
line_item_id (varchar)
category (varchar)
order_date (date)
cost_price (float)
selling_price (float)
units (int)
I need to write the following queries that produce the following aggregations:
Query 1: Revenue(sum) by month
Query 2: Profit(sum) by category
Query 3: Units(sum), Revenue(sum), sum(Cost) by Day and Category
How would I do that?