Company: Netflix | Difficulty: medium
Find all orders placed during the 30-day period ending March 31, 2025.
Return the columns in this exact order: customer_name, product, and order_date.
customer_name
product
order_date
Include orders placed on March 1, 2025 and March 31, 2025. Exclude orders before March 1, orders after March 31, and orders with a NULL order date.
Sort the results by order_date descending. If multiple orders share the same date, sort by order_id descending.
order_id
orders
The orders from Acme Corp and Initech are included because they fall within the 30-day period ending March 31, 2025. The Globex order is excluded because it was placed before March 1, 2025.
DROP TABLE IF EXISTS orders; CREATE TABLE orders ( order_id INT, customer_name VARCHAR(100), product VARCHAR(100), order_date DATE ); INSERT INTO orders VALUES (1,'Acme Corp','Widget A','2025-03-15'), (2,'Initech','Widget C','2025-03-28'), (3,'Globex','Widget B','2025-02-20');
← All SQL Challenges · Netflix Questions · Learn SQL Free