Above is our Database Schema for the vehicle reservation system we are creating. There are the three main tables of data for the system. These three tables are the Employees, Vehicles, and Reservations. Employees holds all of the necessary information of employees including a KeyFobID that acts as a primary key. The vehicle table holds information on the vehicle that describes the car as well as the last oil change and due date for inspection and registration. There were two contenders for the primary key, the license plate and VIN, and we chose the license plate for simplicity. The reservation table holds a lot of information that allows employees to reserve any individual vehicle without any overlap. Some of this important information includes the date, start time, end time, the vehicle license plate, and the key fob ID of the employee.
There are some other tables used to create different relationships and views of the information. The menu table is used to view a three day period of reservations and contains buttons to any other necessary layouts. There is a single relationship between menu and reservations that allows the user to view reservations from the menu. The three copies of the reservation table are used to determine if there is any overlap with reservations that have already been made and the one that the user is creating. The first table shows reservations that conflict with your chosen start time, the second table shows reservations completely enclosed in your selected time frame, and the third table shows reservations that overlap with your ending time. Lastly, there is the copy of the Vehicles table called Vehicles_Free. This table uses the information from all of the reservation tables to determine which vehicles are available at the given data and times that the employee is looking to create a reservation.