Skip to main content

Top Customer by Orders

MediumPremium

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)