我正在开发酒店房间预订系统。
该系统将包含一定数量的酒店,房间和room_categories。我已经有了这些东西的桌子。
目前,我需要构建一个查询以获取给定日期每个房间类别的可用房间数量。
我的房间表是这样的:
--------------------------------------------
| id | name | hotel_id |room_category_id|
--------------------------------------------
| 1 | Room #1 | 1 | 1 |
| 2 | Room #2 | 1 | 1 |
| 3 | Room #3 | 1 | 2 |
| 4 | Room #4 | 1 | 2 |
| 5 | Room #5 | 1 | 3 |
| 6 | Room #6 | 1 | 3 |
| 7 | Room #7 | 1 …Run Code Online (Sandbox Code Playgroud)