<aside> 💡

Project Overview:

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>


Problem Description:

Tables:

  1. Sales:
  2. Product:

The task is to generate a report containing:

The result should include data for all sales.


Solution:

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;


Explanation:

  1. Joining Tables:
  2. Selecting Columns: