Create a customer-level summary showing each customer's name, total number of orders, and total amount spent. Include customers who have not placed any orders (show 0 for counts and amounts). Sort by total spent descending.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute