My issue
Plz solve this code
My code
/* Write a query to perform the following
- Join the tables - 'product_catalog' and division_product_sales'
- Output product_id, units_sold as min_sold and month from the joined table
- Remember the condition - we need to identify the worst performing month for each product_id in terms of units sold
- Order by product_id */
SELECT
dps.product_id,
dps.units_sold,
dps.month
FROM
division_product_sales dps
JOIN
product_catalog pc
ON
dps.product_id = pc.product_id
WHERE
dps.units_sold = (
SELECT
MIN(units_sold)
FROM
division_product_sales
WHERE
product_id = dps.product_id
)
ORDER BY
dps.product_id;
Learning course: Database management systems
Problem Link: Project - Correlated Subquery and Table Join in Database management systems