Skip to content
Skills
Problems
Questions
Roles
Skills
Interview
Contest
Leaderboard
Problems
Questions
Roles
Skills
Interview
Contest
Leaderboard
Home
/
Data Scientist
/
Easy
/
Counting orders per customer
easy
5 pts · first answer counts
sql
Counting orders per customer
Which SQL query returns the number of orders for each customer?
Choose one answer
A.
SELECT customer_id, COUNT(*) FROM orders;
B.
SELECT COUNT(DISTINCT customer_id) FROM orders;
C.
SELECT customer_id, COUNT(*) AS n_orders FROM orders GROUP BY customer_id;
D.
SELECT customer_id FROM orders ORDER BY COUNT(*);
Submit answer
Report a problem
← Ice cream and drowning
Customers with no orders →