Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Questions that require you to write MySQL views/stored programs/triggers will refer to this Car rental agency schema. Please download and use this dump of
Questions that require you to write MySQL views/stored programs/triggers will refer to this Car rental agency schema. Please download and use this dump of the tables & data for the schema. (Download the .sql file, open it in the MySQL Workbench, and run the script) Please take a few minutes to understand this schema before proceeding to the actual questions. Customer id INT first_name VARCHAR(40) last_name VARCHAR (40) licence_number VARCHAR(20) street VARCHAR (100) city VARCHAR(50) state VARCHAR (50) zip_code VARCHAR(10) Indexes CarType id INT num ber_of_seats INT daily_rate DECIMAL (10,2) description TEXT Indexes HEI H I I T Car id INT Reservation reservation_id INT customer_id INT car_type_id INT pick_up_date DATE drop_off_date DATE car_id INT Indexes licence_plate_number VARCHAR(10) make VARCHAR (20) model VARCHAR(30) Indexes year_manufactured YEAR type_id INT status TINY INT (1) Consider the Car rental agency schema given to you for this test. You are supposed to already create the databased by downloading the .sql file, opening it in the MySQL Workbench, and running the script. Write a query to create a view named OngoingReservations that contains the reservation ID, IDs and names of the customer (first and last names concatenated) and reservation dates (pick- up and drop-off dates) for all ongoing reservations (even reservations ending on the current date should count). The format (not data) of your output should be similar to the sample shown below. Reservation ID Customer ID Customer name Reservation dates (from - to) Tyrion Lannister 12/07/2018 - 12/10/2018 1 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started