Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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

More Books

Students also viewed these Databases questions

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago