20251108073503.webp
P

20251108073503.webp

  • Media owner Panda89
  • Ngày thêm
Question paper (build 07.05.20.19)
Question 6:
Picture 5.1
Write an SQL query to list all customers whose total spending on completed orders in 2025
is below the average total spending in 2025 of all customers, including those who made no
orders. For each customer, display: CustomerID, FullName, TotalAmount (the total value of
all completed orders in 2025 (use 0 for customers with no orders)). Ensure calculating the
average total spending based on all customers, including those with 0 spending. Sort the
output by TotalAmount in descending order, then by CustomerID in ascending order for
customers having the same TotalAmount.
5 of 5
Paper No: 10
CustomerID
FullName
TotalAmount
12
2
45
46
Phạm Văn Quang
1315000.00
45
Lê Thị Tâm
1310000.00

Thông tin

Category
DBI202
Thêm bởi
Panda89
Ngày thêm
Lượt xem
579
Lượt bình luận
1
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom