Best and easiest MySQL solution ✅ || JOIN ✅ || LIKE ✅ || Beginner-friendly ✅
Intuition\n Describe your first thoughts on how to solve this problem. \n- The question asks to retrieve the product whose atleast 100 units were sold in Februa
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- The question asks to **retrieve the product whose atleast 100 units were sold in February 2020**.\n- We use LEFT JOIN with Orders on the left side so as to include all the products that have been ordered.\n- We use the **LIKE** keyword to check for order_date in Febraury 2020. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. In the SELECT statement, we retrieve the `product_name` and `SUM(unit) as unit`\n2. In the FROM statement, we perform **LEFT JOIN with Orders on the left side** so as to include all the products that were ordered. \n3. The **WHERE clause** states the condition that the orders were made in February 2020 using `WHERE order_date LIKE \'%2020-02-%\'`\n4. The **GROUP BY** clause groups the query result by product_name so that we can retrieve the units sold for each product.\n5. The **HAVING** keyword states the condition that we retrieve only the product whose 100 units were sold in February 2020.\n\n\n# Code\n```\n# Write your MySQL query statement below\nSELECT product_name, SUM(unit) as unit\nFROM Orders O LEFT JOIN Products P using(product_id)\nWHERE order_date LIKE \'%2020-02-%\'\nGROUP BY product_name\nHAVING unit>=100;\n```
['MySQL']