Sie sind auf Seite 1von 9

Test: Final Exam Semester 2

Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Final Exam Semester 2 1. You have created several directory objects in the database, as pointers to operating system directories which contain BFILEs. Which data dictionary view w ould you query to see these directories? Mark for Review (1) Points USER_DIRECTORIES USER_BFILES ALL_DIRECTORIES (*) USER_EXTERNAL_FILES ALL_BFILES Incorrect. Refer to Section 11. 2. Which of the following must be used to populate a BFILE column with a loca tor value? Mark for Review (1) Points The DBMS_LOB.FILEGETNAME procedure The DBMS_LOB.BFILENAME function The BFILENAME function (*) The BFILELOCATOR function The DBMS_LOB.FILOPEN procedure Incorrect. Refer to Section 11. 3. Which of the following statements about BFILEs are NOT true? (Choose two.) Mark for Review (1) Points (Choose all correct answers) They are stored outside the database. We can read BFILE data using the DBMS_LOB package. We can grant SELECT object privilege on them. (*) We can read BFILE data in a SELECT statement. (*)

The database contains a locator which points to the external BFILE. Incorrect. Refer to Section 11. 4. The JOB_APPLICANTS table contains two columns: (applicant_id NUMBER PRIMARY KEY, resume CLOB) For applicant_id 100, we want to modify the value of the RESUME column value fro m "I worked for Oracle" to "I worked for Oracle for five years". Which of the following will do this successfully? (Choose two.) Mark for Review (1) Points (Choose all correct answers) UPDATE job_applicants SET SUBSTR(resume, 21,14) = 'for five years' WHERE candidate_id = 100; UPDATE job_applicants SET resume = 'I worked for Oracle for five years' WHERE candidate_id = 100; (*) DECLARE v_locator CLOB; BEGIN v_locator := 'I worked for Oracle for five years'; UPDATE job_applicants SET resume = DBMS_LOB.WRITE(v_locator) WHERE candidate_id = 100; END; DECLARE v_lobloc CLOB; BEGIN SELECT resume INTO v_lobloc FROM job_applicants WHERE applicant_id = 100; DBMS_LOB.WRITE(v_lobloc,14,21,'for five years'); END; (*)

Incorrect. Refer to Section 11. 5. CLOB and BLOB are internal LOB datatypes, while BFILE is an external LOB d atatype. True or False? Mark for Review (1) Points True (*) False

Incorrect. Refer to Section 11.

Page 1 of 4

Test: Final Exam Semester 2

Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Final Exam Semester 2 6. Which of the following best describes the difference between BLOB and BFIL E data? Mark for Review (1) Points A BLOB can contain text data while a BFILE cannot. BLOB data is stored inside the database, while BFILE data is outside the dat abase in separate operating system files. (*) The maximum size of a BLOB is 2GB; a BFILE can be up to 128TB if needed. A table can contain several BLOB columns but only one BFILE column. There is no difference between a BLOB and a BFILE. Incorrect. Refer to Section 11. 7. You need to store very large amounts of text data in a table column inside the database. Which datatype should you use for this column? Mark for Review (1) Points CLOB (*) BLOB LONG VARCHAR2(4000) None of the above Incorrect. Refer to Section 11. 8. BLOB, JPEG, BFILE and MP3 are all LOB column datatypes. True or False? Ma

rk for Review (1) Points True False (*) Incorrect. Refer to Section 11. 9. Examine the following code: DECLARE CURSOR emp_curs IS SELECT employee_id, first_name, last_name FROM employees; TYPE t_mytype IS TABLE OF -- Point A INDEX BY BINARY_INTEGER; v_mytab t_mytype; Which of the following can be coded at Point A? Mark for Review (1) Points employees%ROWTYPE employees.salary%TYPE emp_curs%ROWTYPE Any one of the above (*) None of the above Incorrect. Refer to Section 11. 10. Which of the following PL/SQL data structures can store a collection? (Ch oose two.) Mark for Review (1) Points (Choose all correct answers) An INDEX BY table (*) A record %ROWTYPE An INDEX BY table of records (*) A BLOB Incorrect. Refer to Section 11.

Page 2 of 4

Test: Final Exam Semester 2

Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Final Exam Semester 2 11. An INDEX BY table of records can store a maximum of 255 records. True or False? Mark for Review (1) Points True False (*) Incorrect. Refer to Section 11. 12. Examine the following code: CREATE FUNCTION deptfunc RETURN NUMBER IS v_count NUMBER(6); BEGIN SELECT COUNT(*) INTO v_count FROM departments; RETURN v_count; END; Which of the following will display the dependency between DEPTFUNC and DEPARTME NTS? Mark for Review (1) Points SELECT name, type FROM user_dependencies WHERE name IN ('DEPTFUNC','DEPARTMENTS'); SELECT name, type, referenced_name, referenced_type FROM user_dependencies WHERE referenced_name = 'DEPARTMENTS' AND referenced_type = 'TABLE'; (*) SELECT name, type, referenced_name, referenced_type FROM user_dependencies WHERE name = 'DEPARTMENTS' AND type = 'TABLE'; SELECT object_name, object_type FROM user_objects

WHERE object_name IN ('DEPARTMENTS','DEPTFUNC') AND referenced = 'YES';

Incorrect. Refer to Section 12. 13. Which of the following will display the number of invalid package bodies in your schema? Mark for Review (1) Points SELECT COUNT(*) FROM user_objects WHERE object_type = 'PACKAGE BODY' AND status = 'INVALID'; (*) SELECT COUNT(*) FROM user_dependencies WHERE type = 'PACKAGE BODY' AND status = 'INVALID'; SELECT COUNT(*) FROM user_packages WHERE status = 'INVALID'; SELECT COUNT(*) FROM user_objects WHERE object_type LIKE 'PACKAGE%' AND status = 'INVALID';

Incorrect. Refer to Section 12. 14. User BOB wants to know which objects reference his DEPARTMENTS table. Whi ch of the following must he execute to populate the DEPTREE_TEMPTAB table? Mark for Review (1) Points BEGIN utldtree('DEPARTMENTS'); END; BEGIN deptree_fill('TABLE','BOB','DEPARTMENTS'); END; (*) BEGIN deptree_fill('TABLE','DEPARTMENTS'); END; BEGIN ideptree('TABLE','BOB','DEPARTMENTS'); END;

Incorrect. Refer to Section 12. 15. Function FETCH_EMP references the EMPLOYEES table. The table is modified by: ALTER TABLE employees ADD (resume CLOB); When will the ORACLE server try to recompile FETCH_EMP automatically? Mark for Review (1) Points When the command ALTER FUNCTION fetch_emp COMPILE; is executed The next time a user session invokes FETCH_EMP (*) When the RESUME column is dropped from the EMPLOYEES table When FETCH_EMP is dropped and recreated Incorrect. Refer to Section 12.

Page 3 of 4

Test: Final Exam Semester 2

Review your answers, feedback, and question scores below. An asterisk (*) indica tes a correct answer. Final Exam Semester 2 16. A SELECT from the DEPTREE table displays table LOCATIONS at nested level 0 and procedure LOCPROC at nested level 2. This shows that LOCPROC is directly d ependent on LOCATIONS. True or False? Mark for Review (1) Points True False (*) Incorrect. Refer to Section 12. 17. A procedure includes the following code: CURSOR loc_curs IS SELECT location_id, city, country_id FROM locations; Which of the following changes to the LOCATIONS table will allow the procedure t o be recompiled successfully without editing its code? (Choose two.)

Mark for Review (1) Points (Choose all correct answers) RENAME locations TO new_locations; ALTER TABLE locations ADD (climate VARCHAR2(30)); (*) ALTER TABLE locations DROP COLUMN city; ALTER TABLE locations DROP COLUMN postal_code; (*) Incorrect. Refer to Section 12. 18. When a table is dropped, all PL/SQL subprograms that reference the table are automatically dropped. True or False? Mark for Review (1) Points True False (*) Incorrect. Refer to Section 12. 19. Which of the following will declare a composite PL/SQL data type named CO MPO_TYPE, containing two fields named FIELD1 and FIELD2? Mark for Review (1) Points DECLARE compo_type (field1 NUMBER, field2 VARCHAR2(30)); DECLARE TYPE compo_type IS (field1 NUMBER, field2 VARCHAR2(30)); DECLARE TYPE compo_type IS RECORD (field1 NUMBER, field2 VARCHAR2(30)); (*) DECLARE compo_type IS RECORD (field1 NUMBER, field2 VARCHAR2(30));

Incorrect. Refer to Section 11.

20. Package ED_PACK has declared a record type named ED_TYPE in the package s pecification. Which of the following anonymous blocks successfully declares a va riable whose datatype is ED_TYPE? Mark for Review (1) Points DECLARE v_ed_rec IS RECORD ed_pack.ed_type; BEGIN ... DECLARE v_ed_rec ed_pack.ed_type; BEGIN ... (*) DECLARE v_ed_rec ed_pack.ed_type%ROWTYPE; BEGIN... DECLARE v_ed_rec ed_pack.ed_type%TYPE; BEGIN ... None of the above. Variables of datatype ED_TYPE can be declared only within ED_PACK, not in separate subprograms or anonymous blocks.

Incorrect. Refer to Section 11.

Page 4 of 4

Das könnte Ihnen auch gefallen