SET SERVEROUTPUT ON
DECLARE
  v_state      donor.state%TYPE;
  v_contact    donor.contact%TYPE;
  v_yrgoalsum  donor.yrgoal%TYPE;
CURSOR donorcursor is
SELECT state, contact, SUM(yrgoal)
    FROM donor
    GROUP BY state, contact
    HAVING SUM(yrgoal) >
       (SELECT AVG(yrgoal) 
          FROM donor);
BEGIN
    OPEN donorcursor;
    FETCH donorcursor into v_state, v_contact, v_yrgoalsum;
    WHILE donorcursor%FOUND loop
        dbms_output.put_line(v_state || ' ' || v_contact || ' ' || v_yrgoalsum);
        FETCH donorcursor into v_state, v_contact, v_yrgoalsum;
    END loop;
    CLOSE donorcursor;
END;
/
SET SERVEROUTPUT OFF