Orders placed in March 2024

dates

Orders placed in March 2024

Best Buy SQL Interview Question

Best Buy's finance team is closing the books for March 2024 and needs every online order placed that month.

List the order_id and order_date of every order placed in March 2024.

Asked of

  • Data Analyst
  • Business Analyst
  • BI Analyst
  • Product Analyst
  • Analytics Engineer
  • Data Engineer
  • Data Scientist
  • ML Engineer
  • AI Engineer

ordersTable35 rows

Column NameType
order_idBIGINT
customer_idBIGINT
order_dateDATE
statusVARCHAR
amountDOUBLE

ordersExample Input

order_idcustomer_idorder_datestatusamount
101272024-02-18completed295.3
101322024-02-21completed1975
101452024-02-25completed2890.5
101512024-03-01completed210
101682024-03-04completed4100
101762024-03-08canceled62
101832024-03-12completed178.25
101972024-03-16completed340.8
102042024-03-19completed525
102122024-03-23completed2150

Example Output

order_idorder_date
10152024-03-01
10162024-03-04
10172024-03-08
10182024-03-12
10192024-03-16
10202024-03-19
10212024-03-23

Explanation

Orders 1015 to 1021 were placed between March 1 and March 23, so all seven appear, including the one that was canceled. Order 1014 was placed on February 25, so it is left out.

The example above is a small slice of the data. Your query runs against the full tables.