SELECT temp.customerNumber, country, AVG(timeShipped) AS avgTimeShipped
	SELECT customerNumber, shippedDate - orderDate AS timeShipped
	FROM orders
) AS temp
JOIN customers c ON temp.customerNumber = c.customerNumber
GROUP BY customerNumber
ORDER BY country, avgTimeShipped DESC;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter