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?
- DECLARE, BEGIN, EXCEPTION, END
- BEGIN, EXCEPTION, END
- DECLARE, BEGIN, END, EXCEPTION
- BEGIN, END, EXCEPTION
- EXCEPTION, BEGIN, END
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?
- Trigger
- Cursor
- Sequence
- Procedure
- Varcar
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; -- ?;
- SAVE
- COMMIT
- SEND
- ROLLUP
- SAVETRANS
PL/SQL vs SQL
Which statement best describes a key difference between SQL and PL/SQL, particularly regarding procedural capabilities?
- SQL allows for variable declaration inside queries, but PL/SQL does not.
- PL/SQL supports procedural constructs like loops and conditionals, while SQL does not.
- PL/SQL can only be executed outside of the database, while SQL must run inside the database.
- SQL allows exception handling, unlike PL/SQL.
- SQL enables the definition of named blocks; PL/SQL does not.
Packages in PL/SQL
What is a primary benefit of grouping related procedures, functions, and variables into a package in PL/SQL?
- It prevents code from being compiled.
- It enables automatic memory management.
- It enhances modularity and code reusability.
- It encrypts the source code automatically.
- It enforces row-level security policies.