Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fix the store procedure so that it is able to display that execution result similar to the photo Create or Replace PROCEDURE Insurance_Grouping IS v_Customer_type

Fix the store procedure so that it is able to display that execution result similar to the photo

student submitted image, transcription available below

Create or Replace PROCEDURE Insurance_Grouping IS

v_Customer_type VARCHAR2 (10);
v_Insurance_option_desc VARCHAR2(25) ;
v_Insurance_Option_ID Number(1);

CURSOR Insurance_group IS

SELECT
Customer.Customer_type,
Insurance_Option.Insurance_option_desc,
Count (Insurance_option.Insurance_option_ID) as "Numer of Rentals"
FROM Customer
JOIN Rental
ON Customer. Customer_id = Rental.Rental_Customer_ID
JOIN Insurance_Option
ON Insurance_option.Insurance_option_ID = Rental.Insurance_option_ID
where Customer.Customer_type = customer_type group by Customer.Customer_type, Insurance_Option.Insurance_option_desc;

BEGIN

OPEN Insurance_group;
LOOP
FETCH Insurance_group INTO v_Customer_type, v_Insurance_option_desc, v_Insurance_Option_ID;
EXIT WHEN Insurance_group%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Insurance group info ' ||v_Customer_type|| ' | ' ||v_Insurance_option_desc|| ' | ' ||v_Insurance_Option_ID);
END LOOP;
CLOSE Insurance_group;
END Insurance_Grouping;
 

CUSTOMER_TYPE Retail Corporate Retail Retail Corporate Retail INSURANCE_OPTION_DESC Additional Driver Bodily Injury No Insurance Bodily Injury No Insurance Physical Damage Numer of Rentals 1 2 1 2 2 2

Step by Step Solution

3.43 Rating (162 Votes )

There are 3 Steps involved in it

Step: 1

To display the execution result of the stored procedure you can use th... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Electronic Commerce

Authors: Gary Schneider

12th Edition

1305867815, 9781305867819

More Books

Students also viewed these Databases questions

Question

1.1 Review how communication skills determine leadership qualities

Answered: 1 week ago