Find the customer who placed the most orders
Company: Databricks
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Write a SQL query over an Orders table that returns the customer number of the customer who placed the most orders. It tests counting rows per customer, picking the top group, and how a guarantee of a unique winner affects the query you write.
Tables
orders(order_number INTEGER, customer_number INTEGER)
Hints
- Work out how many orders each customer has before deciding how to keep only the largest.