Q1_20251108073145.webp
M

Q1_20251108073145.webp

3 of 3
Paper No: 7
TableID TableNumber Capacity
1
1
2
14
1
14
2
2
Picture 2.1
Location
Khu A - Gần cửa sổ
Khu E - Gần cửa sổ
Question 3:
Write an SQL query to display the list of customers who made reservations in the year 2025
and were assigned to tables whose locations include "Khu A". Display the results with
CustomerID, FullName, Reservation Time, TableID, Location, as shown in the following
figure:
Lê Văn Phú
Phạm Văn Quang
Nguyễn Lan Hương
Trần Hữu Nghĩa
TableID
Reservation Time
2025-11-21 19:02:00.000 2
2025-03-02 12:00:00.000 3
2025-01-01 19:15:00.000 2
2025-01-01 19:15:00.000 3
2025-07-13 12:30:00.000 2
2025-09-19 19:15:00.000 2
2025-01-08 19:15:00.000 3
2025-05-23 20:00:00.000 2
2025-05-23 20:00:00.000 3.
2025-06-16 20:00:00.000 3
2025-10-13 13:00:00.000 1
2025-02-13 13:00:00.000 2
2025-09-09 13:00:00.000 3.
2025-03-26 19:45:00.000 2
2025-03-26 19:45:00.000 3
CustomerID FullName
1
40
Đỗ Hoàng Vũ
2
13
Võ Thị Hoa
3
28
Bùi Ngọc Linh
4
28
Bùi Ngọc Linh
5
10
6
46
7
43
8
44
9
44
Trần Hữu Nghĩa
10
33
Đỗ Thị Hiền
11
33
Đỗ Thị Hiền
12
32
13
28
14
4
15
4
Phạm Ngọc Bảo
Bùi Ngọc Linh
Phạm Văn Cường
Phạm Văn Cường
Picture 3.1
Location
Khu A - Trung tâm
Khu A - Góc phải
Khu A - Trung tâm
Khu A - Góc phải
Khu A - Trung tâm
Khu A - Trung tâm
Khu A - Góc phải
Khu A - Trung tâm
Khu A - Góc phải
Khu A - Góc phải
Khu A - Gần cửa sổ
Khu A - Trung tâm
Khu A - Góc phải
Khu A - Trung tâm
Khu A - Góc phải
Question 4:
Write an SQL query to list all tables whose locations include "Khu A", "Khu B" or "Khu C",
along with the customers who reserved them in September 2025. Ensure to include tables
even if no customer reserved them during that month. Show the following columns: TableID,
Capacity, Location, CustomerID, FullName. Sort the result in descending order of Capacity
and then by Location in ascending order for tables with the same capacity.
Zoom
+10 %
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom