Question: 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 tothis 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!