Oracle PL/SQL and SQL Fundamentals

Covers Oracle PL/SQL concepts including cursors (explicit and implicit), packages, variable declarations, exceptions, triggers, and SQL functions

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Select the VALID trigger type(s)?

  1. AFTER statement trigger
  2. INSERT row trigger
  3. DELETE row trigger
  4. UPDATE row trigger
Question 2 Multiple Choice (Single Answer)

Which of the following statements about an SQL statement are not correct?

  1. SQL statements are not case-sensitive, unless indicated.
  2. Keywords can be abbreviated.
  3. SQL statements can be on one or more lines.
  4. Keywords cannot be split across lines.
Question 3 Multiple Choice (Single Answer)

What is a database cursor?

  1. A cursor is SQL keyword specifying a retrieved data order.
  2. Cursor is acronym for Current Set Of Records and is a database object pointing to a currently selected set of records.
  3. A blinking vertical line that indicates the location of the next input on the display screen.
  4. None of the above.
Question 4 Multiple Choice (Single Answer)

What does ACID stand for?

  1. Access. Constraint. Index. Data.
  2. Atomicity. Consistency. Isolation. Durability.
  3. Access. Consistency. Isolation. Data.
  4. None of the above
Question 5 Multiple Choice (Multiple Answers)

Select incorrect variable declarations

  1. foo_text varchar2(10) := 'hello world';
  2. foo_char char(1) := 'Y';
  3. foo_number varchar2(10);
  4. foo_text number(10);
Question 6 Multiple Choice (Single Answer)

What command can you use to see the errors from a recently created view or stored procedure?

  1. SHOW MISTAKES;
  2. SHOW ERRORS;
  3. DISPLAY ERRORS;
  4. DISPLAY MISTAKES;
  5. None of the above.
Question 7 Multiple Choice (Single Answer)

What is the value of l_child_number? DECLARE l_parent_number NUMBER := 1; BEGIN DECLARE l_child_number NUMBER := 2; BEGIN l_child_number := l_parent_number + l_child_number; END; DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number)); EXCEPTION WHEN OTHERS THEN l_child_number := 0; DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number); END;

  1. 1
  2. 2
  3. 3
  4. 0
  5. None of the above
Question 8 Multiple Choice (Single Answer)

Which of the following is not a valid Oracle PL/SQL exception.

  1. NO_DATA_FOUND ORA-01403
  2. DUP_VAL_ON_INDEX ORA-00001
  3. TWO_MANY_ROWS ORA-01422
  4. OTHERS
  5. None of the above. These are all valid.
Question 9 Multiple Choice (Single Answer)

Which of the following is not a grouping function?

  1. DISTINCT
  2. SUM
  3. MIN
  4. COUNT
  5. All of the above.
  6. None of these above.
Question 10 Multiple Choice (Single Answer)

Which of the following is not an Oracle DML function?

  1. DECODE
  2. TRUNCATE
  3. TO_CHAR
  4. NVL
  5. Trick question, all of these are Oracle DML functions.
Question 11 Multiple Choice (Single Answer)

The || is is an example of what function SELECT last_name || ', ' || first_name || ' ' || middle_name FROM employees;

  1. Incantination
  2. Integration
  3. Continuation
  4. Concatenation
  5. Pipeline
  6. None of the above
Question 12 Multiple Choice (Single Answer)

Assuming the date and time is 09/09/2009 09:09:09, what value will the following statement return SELECT TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH24:MI:SS') FROM dual;

  1. 09/09/2009 00:00:00
  2. 09/09/2009 09:09:09AM
  3. 09/09/2009
  4. 09/09/2009 09:09:09
  5. None of the above.
Question 13 Multiple Choice (Single Answer)

Select the best answer. Which listed attribute is an invalid attribute of an Explicit cursor.

  1. %NOTFOUND
  2. %FOUND
  3. %ROWCOUNT
  4. %ISOPEN
  5. None of the above. All of these are valid.
Question 14 Multiple Choice (Single Answer)

Where do you declare an explicit cursor in the PL/SQL language?

  1. In the PL/SQL working storage section
  2. In the PL/SQL declaration section
  3. In the PL/SQL body section
  4. In the PL/SQL exception section
  5. None of the above
Question 15 Multiple Choice (Single Answer)

Select the best answer. This is an example of what _____ type of cursor? DECLARE l_date DATE; BEGIN SELECT TRUNC(SYSDATE) INTO l_date FROM DUAL; END;

  1. Explicit
  2. Implicit
  3. Select
  4. PL/SQL
  5. None of the above
Question 16 Multiple Choice (Single Answer)

Select the best answer. This is an example of what _____ type of cursor? DECLARE l_date DATE; CURSOR c1 IS SELECT TRUNC(SYSDATE) FROM DUAL; BEGIN OPEN c1; FETCH c1 INTO l_date; CLOSE c1; END;

  1. Explicit
  2. Implicit
  3. Select
  4. PL/SQL
  5. None of the above.
Question 17 Multiple Choice (Single Answer)

Select the best answer to complete this variable declaration for a record. DECLARE l_foo_table SOME_TABLE_________; BEGIN ...

  1. %ROWTYPE
  2. %TABLE
  3. %COLUMNTYPE
  4. %TYPE
  5. None of the above
Question 18 Multiple Choice (Single Answer)

Select the best answer to complete this variable declaration for a column value. DECLARE l_foo_column_id SOME_TABLE.SOME_COLUMN_________; BEGIN ...

  1. %ID
  2. %ROWTYPE
  3. %TYPE
  4. %COLUMNTYPE
  5. None of the above.
Question 19 Multiple Choice (Single Answer)

Select the best answer PACKAGE foo_foo IS PROCEDURE foo ( p_foo_text IN VARCHAR2 ); PROCEDURE foo (p_foo_number IN NUMBER); END;

  1. Package specification is invalid. Too many procedures named foo.
  2. Package specification is invalid. First procedure should be called called foo_1, second procedure should be called foo_2.
  3. Package specification is valid. This is an example of overloading.
  4. Package specification is invalid. We can only have one procedure named foo in the package
  5. Package specification is valid. We can have an unlimited number of procedures name foo.
  6. None of the above
Question 20 Multiple Choice (Single Answer)

List the correct sequence of commands to process a set of records when using explicit cursors

  1. INITIALIZE, GET, CLOSE
  2. OPEN, FETCH, CLOSE
  3. CURSOR, GET, FETCH, CLOSE
  4. CURSOR, FETCH, CLOSE
  5. GET, SEEK, HIDE
  6. None of the above.