【发布时间】:2011-08-18 10:12:18
【问题描述】:
我的任务是创建一个在线酒店预订系统。我遇到的问题是查找特定日期范围内特定房间类别的可用房间的查询。我的数据库设计涉及 4 个表。数据库设计如下:
tbl_reservationdetails ( stores the general details of the reservation )
pk resrvdtl_id (primary key)
fk client_id (insignificant for now)
start_date (customer's check-in-date)
end_date (customer's check-out-date)
tbl_reservation (stores the rooms reserved for a particular reservation )
pk reserv_id (primary key)
fk resrvdtl_id (foreign key, to know to whom and when the room should be occupied)
fk room_id (the room reserved)
tbl_room
pk room_id (primary key)
room_number
fk room_categId (to know what category this room belongs to)
tbl_roomcategory
pk room_categId (primary key)
room_category (description of category.. example: Suite, Superior, Deluxe etc. in my case... there are four categories)
用户输入的是日期(开始和结束),以及他想要的房间类别。我对此很陌生......我如何查询以检查特定日期该类别的可用房间??????
对此的任何回应将不胜感激......谢谢
【问题讨论】:
-
这看起来有点像家庭作业 - 也许先展示你的工作 - 提示你需要使用连接
-
我会添加
tbl_room.room_notes,例如'靠近电梯'(或'...电梯',如果它在另一边大西洋)或'市中心的美景'。
标签: sql