End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
Products table with the Orders table on the product_id column.order_date in February 2020.product_id (and product_name to include it in the final result).unit column to get the total units ordered for each product.HAVING clause to filter the groups to only include those with a sum of units greater than or equal to 100.product_name and the sum of unit as the final output.
erDiagram
Products {
int product_id PK
varchar product_name
varchar product_category
}
Orders {
int product_id FK
date order_date
int unit
}
Products ||--o{ Orders : contains