-1

Difficult to explain, but essentially: I am producing a database for a business where customers rent vehicles and perhaps drivers for a short period of time. I am struggling to prevent vehicles and drivers from being booked multiple times. Ideally, drivers can drive multiple vehicles, but of course only one vehicle per booking, the time increment is in days.

I am familiar with Access, but a relative novice with SQL. Currently, I have a main "bookings" table with one-to-many relationships with "drivers" and "vehicle" tables.

Am I thinking along the right track that I should be trying to use multiple primary keys with each ID to the rental start date and rental end date?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

0

Your question is very high level in being about fundamental database application design. Yes one needs the 3 tables you identify. All tables should have an autonumber primary key. For this type of rental app it is always challenging to get a handle on managing the dates to avoid double booking - but it is a matter of setting up your queries correctly.

Cahaba Data
  • 624
  • 1
  • 4
  • 4