php - MySql what's the best way to insert bookings -


i have database looks this

enter image description here

i wondering separate tables , such, insert 1 table @ time, insert row in booking, insert row in customers, , last insert row in booking_has_customers? there easier way this?

halls unchanging in case have more rooms hire.

and when retrieving data database, best use join on foreign keys full overview incase need data?

thanks in advance!

  1. no there no easier way, need insert data each table individually. however, exact situation asks transactions. transactions ensure either required insertions happen, or none of them.

  2. this question pretty broad , cannot answered. if makes sense retrieve data multiple tables, joins answer , foreign keys starting points join condition. join condition may have contain expressions beyond foreign keys. depends actual use case.

i rather ask specific questions specific use cases reports / queries in separate questions. way can answers tailored exact question.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -