✅Easiest Basic Sql Solution |3 Approaches| Beginner Level to Advance🏆
\n#Approach 1-Join\nSELECT \n    p.product_name, \n    SUM(o.unit) AS unit\nFROM \n    Products p\nJOIN \n    Orders o ON p.product_id = o.product_id\nWHERE \n 
```\n#Approach 1-Join\nSELECT \n    p.product_name, \n    SUM(o.unit) AS unit\nFROM \n    Products p\nJOIN \n    Orders o ON p.product_id = o.product_id\nWHERE \n    o.order_date BETWEEN \'2020-02-01\' AND \'2020-02-29\'\nGROUP BY \n    p.product_id, \n    p.product_name\nHAVING \n    SUM(o.unit) >= 100;\n\n```\n\n\n```\n#Approach 2-CTE(Common Table Expression)\nWITH FebruaryOrders AS (\n    SELECT product_id, SUM(unit) AS total_units\n    FROM Orders\n    WHERE order_date BETWEEN \'2020-02-01\' AND \'2020-02-29\'\n    GROUP BY product_id\n    HAVING SUM(unit) >= 100\n)\nSELECT p.product_name, fo.total_units AS unit\nFROM Products p\nJOIN FebruaryOrders fo ON p.product_id = fo.product_id;\n\n```\n\n```\n#Approach 3-Subquey Filtering\nSELECT product_name, total_units AS unit\nFROM (\n    SELECT p.product_name, SUM(o.unit) AS total_units\n    FROM Products p\n    JOIN Orders o ON p.product_id = o.product_id\n    WHERE o.order_date BETWEEN \'2020-02-01\' AND \'2020-02-29\'\n    GROUP BY p.product_id, p.product_name\n) AS FebruaryOrders\nWHERE total_units >= 100;\n\n\n```
['MySQL', 'MS SQL Server']