SQL Exception Handling MCQ Questions and Answers

This section focuses on the "Exception Handling" in SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. How many types of exception are there in sql?

A. 2
B. 3
C. 4
D. 5

View Answer


2. Name the exception which is raised when a null object is automatically assigned a value?

A. CASE_NOT_FOUND
B. COLLECTION_IS_NULL
C. ACCESS_INTO_NULL
D. DUP_VAL_ON_INDEX

View Answer


3. What is oracle error code for exception COLLECTION_IS_NULL?

A. "06530"
B. "06592"
C. "06531"
D. "01722"

View Answer


4. What is true about PROGRAM_ERROR?

A. It is raised when a SELECT INTO statement returns no rows.
B. It is raised when PL/SQL has an internal problem.
C. It is raised when PL/SQL ran out of memory or memory was corrupted.
D. It is raised when a SELECT INTO statement returns more than one row.

View Answer


5. An exception is an error condition during a program execution.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


6. The default exception will be handled using?

A. Default Keyword
B. WHEN THEN Keyword
C. WHEN Keyword
D. WHEN others THEN Keyword

View Answer


7. Which of the following exception raised when an arithmetic, conversion, truncation, or sizeconstraint error occurs?

A. ZERO_DIVIDE
B. VALUE_ERROR
C. TOO_MANY_ROWS
D. SELF_IS_NULL

View Answer


8. What is the sql error code for SELF_IS_NULL?

A. "-6504"
B. "-30625"
C. "-1422"
D. "-6502"

View Answer


9. Point out the correct statement.

A. While executing some DML Statement like INSERT, DELETE, UPDATE we can handle the error for checking proper output
B. If transaction fails, then we need to commit – This can be done by error handling
C. If transaction succeeds, then we need to rollback – This can be done by error handling
D. All of the above

View Answer


10. Which statements can be checked for handling errors.

A. DDL
B. TCL
C. DML
D. TTL

View Answer






Discussion


* You must be logged in to add comment.