Question: 1. Fix the follow PL/SQL: BEGIN DECLARE Name VARCHAR(50) := 'Rob'; Budget NUMBER := 700; Counter NUMBER; CURSOR all_products AS SELECT * FROM PRODUCTS; Counter

1. Fix the follow PL/SQL: BEGIN DECLARE Name VARCHAR(50) := 'Rob'; Budget NUMBER := 700; Counter NUMBER; CURSOR all_products AS SELECT * FROM PRODUCTS; Counter := 0; LOOP FOR items IN all_products IF (items.LIST_PRICE < Budget) THEN Counter := Counter + 1; END IF; END LOOP; DBMS_OUTPUT.PUT_LINE(Name || ', you can afford ' || TO_CHAR(Counter) || ' items.'); END; / 2. When you have Exercise 1 working, what is the output from the script? 3. Write a new script that uses an anonymous block of PL/SQL code to declare a variable and set it to the count of all products in the Products table. If the count is greater than or equal to 7, the block should display a message that says, The number of products is greater than or equal to 7. Otherwise, it should say, The number of products is less than 7.

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!