Product Sales Analysis I

2pts
Amazon

Problem Statement

To improve business reporting, you need to enrich raw sales data with descriptive names for each item sold.

Write an SQL query to report the product_name, year, and price for each sale_id in the Sales table.

Rules:

  • You must retrieve information from both the Sales and Product tables.
  • Each row in the output should represent a single sale record.
  • The order of the results does not matter.
Tests your understanding of
Basic SQL, Joins, Relational Mapping and Inner Join

Input Tables

sales
sale_id(INTEGER)product_id(INTEGER)year(INTEGER)quantity(INTEGER)price(INTEGER)
11002024105000
21002025125000
72002025159000
8300202351200
9100202324500
102002024208500
product
product_id(INTEGER)product_name(VARCHAR)
100Echo Dot
200Kindle
300Fire Stick

Expected Output

product_name(VARCHAR)year(INTEGER)price(INTEGER)
Echo Dot20245000
Echo Dot20255000
Kindle20259000
Fire Stick20231200
Echo Dot20234500
Kindle20248500

Tags

EasyBasic SQLJoinsRelational MappingInner Join
5-10 min
85%

Hints