14:57 Wed 5 Jun Αα ΓΟ 75% פי Primary keys indicated by * 5 June 2024 at 14:56 SERVICE_BOOKING (BookingID*, License Plate, Model, Brand, RequestDate) BOOKING_AVAILABILITY (Date*, Opening Time, Closing Time, AvailableSlots) REQUESTED_SERVICES (License Plate*, ServiceType*) SERVICE_COSTS (ServiceType*, Brand*, Model*, Cost) SERVICE_NOTIFICATION (BookingID*, License Plate, ServiceDate, Opening Time, Closing Time, Total Cost) Write a trigger to manage the bookings for vehicle service at a specialized workshop. A booking request for vehicle service is inserted (a record is inserted into the SERVICE_BOOKING table), specifying the type of vehicle (brand and model) and the date when the service is requested (attribute RequestDate). The trigger must perform the following operations: Select the first date (on or after the requested date) where there are still available slots. The BOOKING_AVAILABILITY table indicates, for each date, the opening and closing times of the workshop, and the number of slots still available for vehicle service on that date. If there are no available slots on any date, the booking request must be canceled. Otherwise, the following operations must be performed: • Update the number of available slots on the selected date. Calculate the total cost of the service. The REQUESTED_SERVICES table stores the list of service types requested for the vehicle booked for service. The SERVICE_COSTS table stores the cost for each service type based on the brand and model of the vehicle. Notify the successful booking by inserting a new record into the SERVICE_NOTIFICATION table, providing details about the selected date and the opening and closing times on that date, and the total cost for the service.

icon
Related questions
Question
14:57 Wed 5 Jun
Αα
ΓΟ
75%
פי
Primary keys indicated by *
5 June 2024 at 14:56
SERVICE_BOOKING (BookingID*, License Plate, Model, Brand, RequestDate)
BOOKING_AVAILABILITY (Date*, Opening Time, Closing Time, AvailableSlots)
REQUESTED_SERVICES (License Plate*, ServiceType*)
SERVICE_COSTS (ServiceType*, Brand*, Model*, Cost)
SERVICE_NOTIFICATION (BookingID*, License Plate, ServiceDate, Opening Time,
Closing Time, Total Cost)
Write a trigger to manage the bookings for vehicle service at a specialized workshop.
A booking request for vehicle service is inserted (a record is inserted into the
SERVICE_BOOKING table), specifying the type of vehicle (brand and model) and the
date when the service is requested (attribute RequestDate). The trigger must perform
the following operations:
Select the first date (on or after the requested date) where there are still available
slots. The BOOKING_AVAILABILITY table indicates, for each date, the opening and
closing times of the workshop, and the number of slots still available for vehicle
service on that date.
If there are no available slots on any date, the booking request must be canceled.
Otherwise, the following operations must be performed:
•
Update the number of available slots on the selected date.
Calculate the total cost of the service. The REQUESTED_SERVICES table stores
the list of service types requested for the vehicle booked for service. The
SERVICE_COSTS table stores the cost for each service type based on the brand
and model of the vehicle.
Notify the successful booking by inserting a new record into the
SERVICE_NOTIFICATION table, providing details about the selected date and the
opening and closing times on that date, and the total cost for the service.
Transcribed Image Text:14:57 Wed 5 Jun Αα ΓΟ 75% פי Primary keys indicated by * 5 June 2024 at 14:56 SERVICE_BOOKING (BookingID*, License Plate, Model, Brand, RequestDate) BOOKING_AVAILABILITY (Date*, Opening Time, Closing Time, AvailableSlots) REQUESTED_SERVICES (License Plate*, ServiceType*) SERVICE_COSTS (ServiceType*, Brand*, Model*, Cost) SERVICE_NOTIFICATION (BookingID*, License Plate, ServiceDate, Opening Time, Closing Time, Total Cost) Write a trigger to manage the bookings for vehicle service at a specialized workshop. A booking request for vehicle service is inserted (a record is inserted into the SERVICE_BOOKING table), specifying the type of vehicle (brand and model) and the date when the service is requested (attribute RequestDate). The trigger must perform the following operations: Select the first date (on or after the requested date) where there are still available slots. The BOOKING_AVAILABILITY table indicates, for each date, the opening and closing times of the workshop, and the number of slots still available for vehicle service on that date. If there are no available slots on any date, the booking request must be canceled. Otherwise, the following operations must be performed: • Update the number of available slots on the selected date. Calculate the total cost of the service. The REQUESTED_SERVICES table stores the list of service types requested for the vehicle booked for service. The SERVICE_COSTS table stores the cost for each service type based on the brand and model of the vehicle. Notify the successful booking by inserting a new record into the SERVICE_NOTIFICATION table, providing details about the selected date and the opening and closing times on that date, and the total cost for the service.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer