ICE 8 DATABASE
DECLARE
avg_price DECIMAL(10, 2);
BEGIN
-- Calculate the average price of all events
SELECT AVG(event_price) INTO avg_price FROM events;
-- Display events with a price greater than the average
FOR event_record IN
(SELECT event_name, event_price
FROM events
WHERE event_price > avg_price)
LOOP
DBMS_OUTPUT.PUT_LINE(event_record.event_name || ' - PRICE R' ||
event_record.event_price);
END LOOP;
END;