Zoom
4 of 4
Paper No: 11
TableID Capacity Location
1234567% 0
8
8
Khu C - Trung tâm
7
4
6
Khu B - Gần quầy bar
4
4
6
Khu B - Gần quầy bar
24
CustomerID FullName
Bùi Thị Ngọc
Phạm Văn Cường
Lê Minh Hoàng
7
6
Khu C - Gần sân khấu
4
Phạm Văn Cường
3
4
Khu A - Góc phải
28
Bùi Ngọc Linh
2
4
Khu A - Trung tâm
46
Phạm Văn Quang
6
4
Khu B - Trung tâm
12
Đỗ Đức Thịnh
8
1
2
Khu A - Gần cửa sổ
NULL
NULL
9
5
2
Khu B - Cạnh tưởng
NULL
NULL
10
9
2
Khu C - Góc trái
NULL
NULL
Picture 4.1
Question 5:
Write an SQL query to list all customers whose full name starts with "Nguyễn" or "Bùi",
showing for each customer: CustomerID, FullName, the number of completed orders they
made in the year 2025 (column NumberOfOrders), and the total amount spent on those
orders (column TotalAmount). If a customer has no completed order in 2025, still display
their name with NumberOfOrders = 0 and TotalAmount = 0.
CustomerID FullName
NumberOfOrders TotalAmount
1
1
| Nguyễn Thị Mai
2
1902000.00
2
7
Bùi Thị Ngọc
0
0.00
3
8
Nguyễn Hoàng Nam
1
573000.00
4
14
Bùi Văn Lâm
0
0.00
5
15
Nguyễn Thị Hồng
3
1576000.00
6
21
Rủi Thi Nhung
3
2156000.00
+ 100%
Close