Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Ordered in every month of Q1 2024

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.

Constraints

  • Only January–March 2024 counts.

Examples

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

intermediate

Ordered in every month of Q1 2024

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.