Skip to main content
All Questions

Top Customer by Orders

Medium
Unlock detailed company stats for this questionUpgrade

You are given the following tables:

transactions table:

iduser_idcreated_atproduct_idquantity
integerintegerdatetimeintegerinteger

products table:

idnameprice
integerstringfloat

users table:

idnamesex
integerstringstring

Write a query to find the name of the customer who has placed the largest number of orders in total. Your output should have the following column: user_id, name, orders (Total number of orders made by the user)