1084. Sales Analysis III LeetCode Solution
In this guide, you will get 1084. Sales Analysis III LeetCode Solution with the best time and space complexity. The solution to Sales Analysis III problem is provided in various programming languages like C++, Java, and Python. This will be helpful for you if you are preparing for placements, hackathons, interviews, or practice purposes. The solutions provided here are very easy to follow and include detailed explanations.
Table of Contents
- Problem Statement
- Complexity Analysis
- Sales Analysis III solution in C++
- Sales Analysis III solution in Java
- Sales Analysis III solution in Python
- Additional Resources

Problem Statement of Sales Analysis III
Table: Product
+————–+———+
| Column Name | Type |
+————–+———+
| product_id | int |
| product_name | varchar |
| unit_price | int |
+————–+———+
product_id is the primary key (column with unique values) of this table.
Each row of this table indicates the name and the price of each product.
Table: Sales
+————-+———+
| Column Name | Type |
+————-+———+
| seller_id | int |
| product_id | int |
| buyer_id | int |
| sale_date | date |
| quantity | int |
| price | int |
+————-+———+
This table can have duplicate rows.
product_id is a foreign key (reference column) to the Product table.
Each row of this table contains some information about one sale.
Write a solution to report the products that were only sold in the first quarter of 2019. That is, between 2019-01-01 and 2019-03-31 inclusive.
Return the result table in any order.
The result format is in the following example.
Example not found
Constraints not found
Complexity Analysis
- Time Complexity: Google AdSense
- Space Complexity: Google Analytics
1084. Sales Analysis III LeetCode Solution in C++
SELECT
Product.product_id,
Product.product_name
FROM Product
INNER JOIN Sales
USING (product_id)
GROUP BY 1, 2
HAVING SUM(
Sales.sale_date < '2019-01-01'
OR Sales.sale_date > '2019-03-31'
) = 0;
/* code provided by PROGIEZ */
1084. Sales Analysis III LeetCode Solution in Java
N/A
// code provided by PROGIEZ
1084. Sales Analysis III LeetCode Solution in Python
N/A
# code by PROGIEZ
Additional Resources
- Explore all LeetCode problem solutions at Progiez here
- Explore all problems on LeetCode website here
Happy Coding! Keep following PROGIEZ for more updates and solutions.