Which statement is true about the execution of these commands?

Examine the commands:

CREATE TYPE typ_course_tab IS VARRAY(5) OF VARCHAR2(20)
/
CREATE TYPE typ_course_nst
AS TABLE OF typ_course_tab
/
CREATE TABLE faculty
( faculty_id NUMBER(5),
faculty_name VARCHAR2(30),
courses typ_course_nst)
NESTED TABLE courses STORE AS course_stor_tab
/
INSERT INTO faculty
VALUES (101, ‘Jones’, NULL);

UPDATE (SELECT courses FROM faculty WHERE faculty_id=101) SET courses = typ_course_nst(11,’Oracle’);

Which statement is true about the execution of these commands?(Exhibit)

Examine the commands:

CREATE TYPE typ_course_tab IS VARRAY(5) OF VARCHAR2(20)
/
CREATE TYPE typ_course_nst
AS TABLE OF typ_course_tab
/
CREATE TABLE faculty
( faculty_id NUMBER(5),
faculty_name VARCHAR2(30),
courses typ_course_nst)
NESTED TABLE courses STORE AS course_stor_tab
/
INSERT INTO faculty
VALUES (101, ‘Jones’, NULL);

UPDATE (SELECT courses FROM faculty WHERE faculty_id=101) SET courses = typ_course_nst(11,’Oracle’);

Which statement is true about the execution of these commands?

A.
All the commands execute successfully.

B.
Only the first two commands execute successfully.

C.
Only the first four commands execute successfully.

D.
Only the first three commands execute successfully.



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Leo Yu

Leo Yu

amend 5th command to
UPDATE (SELECT courses FROM faculty WHERE faculty_id=101) SET courses = typ_course_nst((‘oralce1′,’oracle2’),(‘sqlserver1’.’sqlserver2′));

dames

dames

??
We have here a VARRAY within a Nested Table.
5th statement should actually be:

UPDATE (SELECT courses FROM faculty WHERE faculty_id=101) SET courses = typ_course_nst(typ_course_tab(11,’Oracle’));

1 row updated.

SELECT * FROM faculty;
FACULTY_ID FACULTY_NAME COURSES
———- ———— ——————————————————-
101 Jones BOOK.TYP_COURSE_NST(BOOK.TYP_COURSE_TAB(’11’,’Oracle’))

jain.hofy

jain.hofy

C, the 5th should be as following
UPDATE (SELECT courses FROM faculty WHERE faculty_id=101) SET courses = typ_course_nst(typ_course_tab(11,’Oracle’));