Difficulty: Easy
Correct Answer: NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE
Explanation:
Introduction / Context:
PL/SQL, Oracle's procedural extension to SQL, includes a rich exception handling mechanism. Many exceptions are predefined by Oracle and automatically raised when certain error conditions occur, such as fetching no rows, fetching too many rows, or dividing by zero. Interviewers often ask candidates to name some predefined exceptions to check whether they recognize the most common runtime error conditions and know how to handle them in robust PL/SQL programs.
Given Data / Assumptions:
• The environment is Oracle PL/SQL with predefined named exceptions.
• The question asks for a group that contains only valid predefined PL/SQL exceptions.
• We assume familiarity with common exceptions like NO_DATA_FOUND and TOO_MANY_ROWS.
• No numeric calculations are required; only recognition of exception names is needed.
Concept / Approach:
Oracle defines many standard exceptions in the STANDARD package, such as NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE, DUP_VAL_ON_INDEX, VALUE_ERROR, and INVALID_NUMBER. These exceptions can be referenced directly in PL/SQL code and are raised automatically when the associated error condition occurs. For example, NO_DATA_FOUND is raised when a SELECT INTO returns no rows, TOO_MANY_ROWS when it returns more than one row, and ZERO_DIVIDE when division by zero is attempted. The correct option must contain only such valid predefined names and no imaginary or operating system level error names.
Step-by-Step Solution:
Step 1: Recall examples of common predefined PL/SQL exceptions: NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE, DUP_VAL_ON_INDEX, and VALUE_ERROR.
Step 2: Compare each answer choice with this mental list of known exceptions.
Step 3: See that option a lists NO_DATA_FOUND, TOO_MANY_ROWS, and ZERO_DIVIDE, all of which are well known Oracle predefined exceptions.
Step 4: Observe that option b mixes NO_DATA_FOUND with FILE_NOT_FOUND and INVALID_PATH, which are more related to operating system or file errors, not standard PL/SQL names.
Step 5: Notice that the remaining options include names that do not match Oracle's predefined exception naming pattern and therefore cannot all be correct.
Verification / Alternative check:
You can verify your answer by thinking about typical PL/SQL error handling patterns. Many example programs include WHEN NO_DATA_FOUND THEN or WHEN TOO_MANY_ROWS THEN clauses. Similarly, dividing by a variable that might be zero will often be wrapped in a handler for ZERO_DIVIDE. These names are part of everyday PL/SQL coding. There is no equally common use of exceptions like FILE_NOT_FOUND or PAGE_FAULT as Oracle predefined names, which confirms that option a is the only grouping that includes three standard exceptions recognized by the PL/SQL runtime.
Why Other Options Are Wrong:
Option b combines a valid exception (NO_DATA_FOUND) with FILE_NOT_FOUND and INVALID_PATH, which resemble operating system error descriptions rather than real PL/SQL exception names.
Option c lists PRIMARY_KEY_VIOLATION, FOREIGN_KEY_VIOLATION, and CHECK_CONSTRAINT_FAILED, which might describe constraint problems but are not the actual predefined names used by Oracle.
Option d includes PAGE_FAULT, STACK_OVERFLOW, and SEGMENTATION_FAULT, which are low level system or programming language errors, not PL/SQL exceptions.
Option e uses INVALID_TRIGGER, INVALID_VIEW, and INVALID_SCHEMA, which again sound descriptive but are not the Oracle predefined identifiers.
Common Pitfalls:
Many learners confuse error messages with exception names. Oracle may display descriptive messages such as unique constraint violated, but the corresponding PL/SQL exception is named DUP_VAL_ON_INDEX. Another pitfall is to assume that any meaningful sounding phrase in uppercase is a valid exception. In reality, you must know or look up the exact predefined identifiers. Finally, do not confuse user defined exceptions, which you declare yourself, with the built in exceptions like NO_DATA_FOUND that are always available without declaration.
Final Answer:
The correct choice is NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE, because all three are standard predefined PL/SQL exceptions that are automatically raised for common runtime error conditions and can be handled directly in exception blocks.
Discussion & Comments