My issue
SELECT
pc.product_type,
dps.product_id,
dps.units_sold,
dps.month
FROM
division_product_sales dps
JOIN
product_catalog pc ON dps.product_id = pc.product_id – Join to get product_type
JOIN
monthly_sales ms ON dps.month = ms.month – Join on month, assuming monthly_sales is needed for context
WHERE
pc.product_type = ‘High_Margin’; – Filter by high margin products
My code
SELECT
pc.product_type,
dps.product_id,
dps.units_sold,
dps.month
FROM
division_product_sales dps
JOIN
product_catalog pc ON dps.product_id = pc.product_id -- Join to get product_type
JOIN
monthly_sales ms ON dps.month = ms.month -- Join on month, assuming monthly_sales is needed for context
WHERE
pc.product_type = 'High_Margin'; -- Filter by high margin products
Learning course: Database management systems
Problem Link: Project - JOIN and Filtering in Database management systems