Question Solved1 Answer 1.) Write a PUSQL block to display the country_id and country_name values from the WF_COUNTRIES table for country_id whose values range from 51 through 55. Supply the missing elements of the given code to satisfy the above statement. declare void countries.country_id&type; vename countries.country_nameštype; vetr pls_integer; begin vetr loop select country_id, country_name into void, vename from countries where country_id = dbms_output.put_line (vcid|l' 'vename); votr := exit when vetr 55; end loop; end; 2.) In the code below, three new location IDs for Montreal, Canada, are inserted in the LOCATIONS table. Supply the missing part of the code to satisfy the above statement. DECLARE v_loc_id locations.location_idsTYPE; BEGIN FROM locations SELECT MAX (location_id) INTO WHERE country_id ! = 2; FOR i 1..3 LOOP INSERT INTO locations (location_id, city, country_id) VALUES ( (v_loc_id + i), 'Montreal', 2); END LOOP; END;

DIZNXJ The Asker · Computer Science

Transcribed Image Text: 1.) Write a PUSQL block to display the country_id and country_name values from the WF_COUNTRIES table for country_id whose values range from 51 through 55. Supply the missing elements of the given code to satisfy the above statement. declare void countries.country_id&type; vename countries.country_nameštype; vetr pls_integer; begin vetr loop select country_id, country_name into void, vename from countries where country_id = dbms_output.put_line (vcid|l' 'vename); votr := exit when vetr 55; end loop; end; 2.) In the code below, three new location IDs for Montreal, Canada, are inserted in the LOCATIONS table. Supply the missing part of the code to satisfy the above statement. DECLARE v_loc_id locations.location_idsTYPE; BEGIN FROM locations SELECT MAX (location_id) INTO WHERE country_id ! = 2; FOR i 1..3 LOOP INSERT INTO locations (location_id, city, country_id) VALUES ( (v_loc_id + i), 'Montreal', 2); END LOOP; END;
More
Transcribed Image Text: 1.) Write a PUSQL block to display the country_id and country_name values from the WF_COUNTRIES table for country_id whose values range from 51 through 55. Supply the missing elements of the given code to satisfy the above statement. declare void countries.country_id&type; vename countries.country_nameštype; vetr pls_integer; begin vetr loop select country_id, country_name into void, vename from countries where country_id = dbms_output.put_line (vcid|l' 'vename); votr := exit when vetr 55; end loop; end; 2.) In the code below, three new location IDs for Montreal, Canada, are inserted in the LOCATIONS table. Supply the missing part of the code to satisfy the above statement. DECLARE v_loc_id locations.location_idsTYPE; BEGIN FROM locations SELECT MAX (location_id) INTO WHERE country_id ! = 2; FOR i 1..3 LOOP INSERT INTO locations (location_id, city, country_id) VALUES ( (v_loc_id + i), 'Montreal', 2); END LOOP; END;
See Answer
Add Answer +20 Points
Community Answer
FNO677 The First Answerer
See all the answers with 1 Unlock
Get 4 Free Unlocks by registration

1) Solution for the given question are as follows - declare cid number := 51; cname varchar2(50); begin loop select country_id, country_name into cid,cname from countries where country_id = cid; dbms_output.put_line('CountryId:'||cid||'CountryName:'||cname); cid := cid + 1; if cid > 56 then exit; end if; end loop; end;  2)  2.) In the code below, three new l ... See the full answer