Simple MySQL Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nThe goal is to find the product names and the total number of units sold for each produ
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe goal is to find the product names and the total number of units sold for each product during the specified date range where the total units sold are at least 100.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJoin the Tables: Join the Products and Orders tables based on product_id.\nFilter by Date Range: Filter the orders to include only those within the date range \'2020-02-01\' to \'2020-02-29\'.\nGroup and Aggregate: Group the results by product_name and calculate the sum of units sold for each product.\nApply Having Clause: Use a HAVING clause to include only those products with total units sold of at least 100.\n\n# Complexity\n- Time complexity: O(nlogn).\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n).\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n# Write your MySQL query statement below\nselect p.product_name, sum(o.unit) as unit from Products p join Orders o on p.product_id = o.product_id where order_date >= \'2020-02-01\' and order_date <= \'2020-02-29\' group by product_name having unit >= 100;\n```
['MySQL']