Answer the question
In order to leave comments, you need to log in
How to develop a database for a table reservation system?
Hello. It is necessary to develop a table reservation system for restaurants. So, there is a table 1Restaurants (PlaceId, SomeFields). There is a table 3 Tables (TableId, SomeFields). They are connected by table 2 Restaurants and Tables (PlaceId, TableId). That is, there is a many-to-many relationship between 1 and 3.
Next, there is the 5Orders(BookId,SomeFields) table, which is linked to the tables table through the 4TablesAndOrders(TableId,BookId) table. Have I designed this correctly? Restaurants have many tables, there are many orders for each table at different times. I will be very grateful for the answers)
Answer the question
In order to leave comments, you need to log in
You linked 1 and 3 in a many-to-many way, which means that the same table can belong to several restaurants, I can't imagine how that could be? In my understanding, each of the restaurants owns its own set of tables, in which case table 2 is not needed, and 1 and 3 should be related in a one-to-many way.
Regarding orders: we need one plate with orders, in which there will be a table_id field (BookId, TableId, SomeFields). Your option would be suitable for the case when the order can be for several tables at once.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question