Below is the query, don't forget to enter the semicolon; at the end of the query.
SELECT
country.name,
car_model.name,
sum(sales.quantity*car_model.price) as total_sales
from sales join country
ON country.id = sales.country_id join car_model ON car_model.id = sales.model_id
WHERE
sales.sales_date like "%2020" GROUP BY country.name, car_model.name ORDER BY total_sales asc;
Comments
Post a Comment