Hello everybody, I have the following question:
Lets say we have a tables where we record sales of cars:
TABLE1
order_id
customer_id
order_date
TABLE2
order_id
product_id
quantity
TABLE3
product_id
product_name
product_price
product_model
Relationships between tables are as follows: TABLE1 one-to-many TABLE2, TABLE3 one-to-many TABLE2.
My question is how to make a query which can say how many particular models were sold in specific month and what was the cost of those sales. The trick is that order_date is in normal date format like dd/mm/yy.
I have tried variety of COUNT operations in my queries but everything seems to be doing something wrong and results are far from what I need.