SQL data engineering interview problem. Difficulty: intermediate. Pattern: Aggregation. About 12 minutes. Part of the Pro drill bank.
Find customers who placed at least one lb_orders row in every month of Q1 2024 (January, February, and March). Return customer_id ordered ascending.
Input: lb_orders (2024 Q1 month coverage) customer_id | order_month C01 | 1 C01 | 2 C01 | 3 C03 | 1 Output: customer_id | C01 | Why this passes: Need three distinct months in Q1 2024, not three orders in a single month.
Topics: lakebench, sql, cohort, having.
More SQL interview questions · All interview problems · Learn data engineering
Interview-style drill: Customers with at least one order in each month of Q1 2024.
Find customers who placed at least one `lb_orders` row in every month of Q1 2024 (January, February, and March). Return `customer_id` ordered ascending.