Question: 1 . 1 Data Definition Language operationsa. Using SQL queries, create the five ( 5 ) identified tables from the scenario including ALL related Primary

1.1 Data Definition Language operationsa. Using SQL queries, create the five (5) identified tables from the scenario including ALL related Primary and Foreign constraints where appropriate. (15 Marks)b. Store at least five (5) records into each table created in 1.1. a using INSERT statement. (10 Marks)1.2. Data Selection and Manipulation Operations a. Write a query to change the price of the one of the movies in the TITLE table to 200 using an UPDATE statement. (4 Marks) b. Display the result of the query after performing the update task in 1.2. a.(1 Marks) c. Create a report that contains each customers history of renting videos using the SELECT statement. Be sure to include the customers name, title of unavailable movie (Rented), book_date of the rental, and duration of rentals (calculated as account_rental_date minus book_date) for the reporting period. (4 Marks)1.3. Views, Index and Function (Stored Procedure) a. Create a view named MemberInfo that contains all members information. (2 Marks) b. Obtain and display the result of the created view descending order using member identity. (2 Marks) c. Create a view named MOVIE_VIEW to show the list of movie titles, the availability of each copy, and its expected return date if unavailable (rented out).(3 Marks) d. Display all the result of the created view and order the output by the title. (3 Marks) e. Create an index named title_description on the description column in the title table. (1 Mark) f. As a way of giving back to its customers (members), the management of the rental service has decided to give 40% discount on all movies title selected (UNAVAILABLE due to being rented out) by its customers. Create a function named "MovieTitleDiscount" that calculates 40% discount for each price in the TITLE table. (3 Marks) g. Use the created function to calculate the new price. Display the title_id, title, current price, and discounted price of the movies. (2 Marks)

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!