Database: retails
Question: Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers.
SQL: SELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3