<aside> 💡
This project generates a sales report showing the product name, year, and price for each sale. The solution demonstrates SQL skills in joining tables and extracting relevant data for reporting.
</aside>
Product table).The task is to generate a report containing:
product_nameyearpriceThe result should include data for all sales.
The query joins the Sales and Product tables using product_id and selects the required fields.
SELECT
Product.product_name,
Sales.year,
Sales.price
FROM
Sales
INNER JOIN
Product
ON
Sales.product_id = Product.product_id;
INNER JOIN Product ON Sales.product_id = Product.product_id links each sale in the Sales table to its corresponding product in the Product table.Product.product_name: Retrieves the name of the product.Sales.year: Retrieves the year of the sale.Sales.price: Retrieves the price per unit.