logo

Crowdly

You have a table  orders : Write an SQL query to calculate the tota...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

You have a table orders:

columntype
order_idINT (PK)
customer_idINT
order_dateDATE
amountDECIMAL(10,2)

Write an SQL query to calculate the total spend per customer and rank customers by total spend (highest spender = rank 1)

Example result:

customer_idtotal_spendrank_in_all_customers
20112001
1059502
3097003

More questions like this

Want instant access to all verified answers on moodle.ppke.hu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!