Programs
Campus & Labs
Admissions
Student Success
About
+91 89033 90051
|
+91 93637 93954
Apply Now
☰
Practice
/
SQLLab
/
Top Spending Customers
Medium
+70 XP
Top Spending Customers
⚡ SQL EDITOR
▶ Run Tests
-- Write your PostgreSQL query for: Top Spending Customers SELECT c.customer_id, c.name, SUM(o.total_amount) AS total_spent FROM customers c JOIN orders o ON c.customer_id = o.customer_id GROUP BY c.customer_id, c.name ORDER BY total_spent DESC LIMIT 5;
🖥️ TEST RUNNER & CONSOLE OUTPUT
Run your code to see test results...