Prices
and UnitsSold
tables based on product_id
and ensure the purchase_date
is within the start_date
and end_date
range.price
by units
sold.product_id
and sum both the total revenue and total units sold.product_id
and average_price
.erDiagram Prices { int product_id date start_date date end_date int price } UnitsSold { int product_id date purchase_date int units } Prices ||--o{ UnitsSold : ""