Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Help writing some queries

$
0
0

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?


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>