0

Restaurant

| restaurant_id | names |

Date

| date_id | date |

Time_slots

| time_slots_id | start_time | end_time | restaurant_id | date_id |

Reservations

| reservation_id | No.of.people | time_slots_id|

Relations between tables:

Relation between time slots and restaurants = Many to Many

Relation between time slots and date = Many to Many

Relation between time slots and reservation = One to one

I will try to structure the restaurant reservation db....in which select restaurant than date after select date the available time slots displayed of selected restaurant on that date...If there is any mistake that i did in this sructure than plz guide me.

2
Contributors
3
Replies
21
Views
2 Years
Discussion Span
Last Post by diafol
0

I can't see dates table working easily. Perhaps having a dates_closed table or something?

slots:

 id | start_time | end_time | day | restaurant_id (FK) | status | created_at | updated_at

reservations:

id | slot_id (FK) | date | booking_name | booking_tel | number_seats | comments | status | created_at | updated_at

restaurants:

id | name | address... | status | covers | created_at | updated_at

dates_closed:

id | restaurant_id (FK) | date | from | to | created_at | updated_at

Many variations possible

Edited by diafol

0

thanx for reply...but there is no such date_closed table...i want when sekect restaurant than date...than the available time slots of selected restaurant on that day will appear

0

but there is no such date_closed table

I know, I added it as an example. What I was saying - the inclusion of a separate dates table will make this very much more complicated - far more complicated than needed.

Why do slots have a date attached to them? Surely, these will be the same for a specific day every week?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.