Skip to content

Instantly share code, notes, and snippets.

@inabahare
Created July 19, 2023 08:10
Show Gist options
  • Save inabahare/f540efb72fe986f8110ad7c6b3b4c082 to your computer and use it in GitHub Desktop.
Save inabahare/f540efb72fe986f8110ad7c6b3b4c082 to your computer and use it in GitHub Desktop.
SELECT
cars.style,
SUM(cars.cost_$) AS Revenue,
YEAR(sales.purchase_date) AS Purchase_Year
FROM sales
INNER JOIN cars ON sales.car_id = cars.car_id
WHERE cars.style = 'SUV' AND YEAR(sales.purchase_date) = '2022';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment