Assignment
University
California State UniversityCourse
IS 441 | Database Management SystemsPages
1
Academic year
2023
Alicia Webb
Views
0
p {margin: 0; padding: 0;} .ft00{font-size:18px;font-family:NimbusRomanRegular;color:#000000;} .ft01{font-size:10px;font-family:NimbusRomanRegular;color:#000000;} .ft02{font-size:18px;font-family:NimbusMonoPSRegular;color:#000000;} 13/09/2023 Answer this question below. 1. Make a SQL Query to display 10 customers whose total payment is the lowest. Answer : SELECT c.first_name, c.last_name, SUM(p.amount) AS total_payment FROM customer c LEFT JOIN payment p ON c.customer_id = p.customer_id GROUP BY 1, 2 ORDER BY 3 ASC LIMIT 10 Here’s the output when we run the query :
PostgreSQL Practice #9
Please or to post comments