What is the id of the customer who has the most orders?
select t1.customer_id from customers as t1 join orders as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) desc limit 1
Show me details
select t1.customer_details from customers as t1 join orders as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) desc limit 1
Show me his or her name.
select t1.customer_name from customers as t1 join orders as t2 on t1.customer_id = t2.customer_id group by t1.customer_id order by count(*) desc limit 1