I am making a site for booking trucks online. I am using MySql for database. I have a Table called “Available_Bookings”, each row of which stores a truck, its driver name , driver contact number etc. The truck has some fixed dates on which it can operate. These dates can be 1,2 or any in number. Given a truck I need to know the dates on which it operates.
Any suggestions.. how to design my db?
Thanks
Create a table which has two columns, one for storing the truck_id and date_operational. For each date that a particular truck is operational, insert one entry into this table.
Eg.
Update –
For this you may use the simple query –