Back to problems

Monthly Top Eligible Customer

SQL · DoorDash · Medium

Table: orders order_id is the primary key. Each row represents one order placed by a customer. For each month, identify the single customer with the highest order count who is not classified as high-frequency. A customer is high-frequency in a given month if they placed more than 30 orders that month. If multiple eligible customers tie for the top count, break the tie by choosing the smallest customer_id. Months where every customer is high-frequency should be omitted…

Checking your access…