PL/SQL Foundations and Oracle Integration Essentials Quiz

  1. PL/SQL Block Structure

    Which of the following correctly reflects the mandatory sections of a basic anonymous PL/SQL block in the correct order, considering the use of an exception handler?

    1. DECLARE, BEGIN, EXCEPTION, END
    2. BEGIN, EXCEPTION, END
    3. DECLARE, BEGIN, END, EXCEPTION
    4. BEGIN, END, EXCEPTION
    5. EXCEPTION, BEGIN, END
  2. Cursors Usage

    If you want to fetch multiple rows from a SELECT statement and process each row individually in PL/SQL, which construct should you use?

    1. Trigger
    2. Cursor
    3. Sequence
    4. Procedure
    5. Varcar
  3. PL/SQL and Transaction Control

    In PL/SQL, which statement is used to permanently save all changes made during the current transaction, as shown in the code block BEGIN ... UPDATE employees SET salary = salary * 1.1; -- ?;

    1. SAVE
    2. COMMIT
    3. SEND
    4. ROLLUP
    5. SAVETRANS
  4. PL/SQL vs SQL

    Which statement best describes a key difference between SQL and PL/SQL, particularly regarding procedural capabilities?

    1. SQL allows for variable declaration inside queries, but PL/SQL does not.
    2. PL/SQL supports procedural constructs like loops and conditionals, while SQL does not.
    3. PL/SQL can only be executed outside of the database, while SQL must run inside the database.
    4. SQL allows exception handling, unlike PL/SQL.
    5. SQL enables the definition of named blocks; PL/SQL does not.
  5. Packages in PL/SQL

    What is a primary benefit of grouping related procedures, functions, and variables into a package in PL/SQL?

    1. It prevents code from being compiled.
    2. It enables automatic memory management.
    3. It enhances modularity and code reusability.
    4. It encrypts the source code automatically.
    5. It enforces row-level security policies.