Instruction
Don't give up! Here comes the next table!
Exercise
This time we'll add information about the shop's daily sales.
The sales_history table consists of the following three columns:
product_id- the ID of a given product,date- the date of sale, andamount- the amount of a given product sold on a particular day.
For every day in the sales_history table show the sales of the products with ID's 13, 18, and 15.
Display the date, name, amount, and calorific value of a product.
Order the results by date and then by calorific value.
Stuck? Here's a hint!
Type:
SELECT date, p.name, amount, calories FROM product p JOIN sales_history sh ON p.id = sh.product_id JOIN nutrition_data nd ON nd.product_id = p.id WHERE p.id IN (13, 18, 15) ORDER BY date, calories



