Database-MySQL [3i Infotech Placement]: Sample Questions 155 - 156 of 162

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 155


Describe in Detail


What are the unary operations in Relational Algebra?


  • Projection: Is used to project required column data from a relation.
Understanding of Projection
  • Selection: Is used to select required tuples of the relations.
Understanding of Selection
  • Join: Concatenation of rows from one relation and related rows from another.

Question 156


Describe in Detail


Talk about “Exception Handling” in PL/SQL?


  • PL/SQL provides a feature to handle the Exceptions which occur in a PL/SQL Block known as exception Handling.
  • Using Exception Handling, we can test the code and avoid it from exiting abruptly.

Structure of Exception Handling.


Declaration section


Exception section


WHEN ex_name1 THEN

-Error handling statements

WHEN ex_name2 THEN

-Error handling statements


-Error handling statements


Types of Exception.

There are 3 types of Exceptions.

(a) Named System Exceptions

(b) Unnamed System Exceptions

(c) User-defined Exceptions

(a) Named System Exceptions:

  • System exceptions are automatically raised by Oracle, when a program violates a RDBMS rule.
  • There are some system exceptions, which are raised frequently, so they are pre-defined and given a name in Oracle, which are known as Named System Exceptions.

(b) Unnamed System Exceptions:

  • Those system exceptions for which oracle does not provide a name are known as unnamed system exception.
  • These exceptions do not occur frequently.
  • These Exceptions have a code and an associated message.

    There are two ways to handle unnamed system exceptions:

    • By using the WHEN OTHERS exception handler, or
    • By associating the exception code to a name and using it as a named exception.

(c) User-defined Exceptions:

  • Apart from system exceptions, we can explicitly define exceptions based on business rules.
  • These are known as user-defined exceptions.

Developed by: