Database-MySQL [PCS Infotech Placement]: Sample Questions 3 - 4 of 23

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 3

Edit

Statement

True-False▾

Can a labelled “goto” statement goto the inner loop?

Answer

FALSE

Explanation

Understanding of GOTO Statements
  • The goto allows unconditional branching to another program section.
  • The form of the goto statements as follows:

    goto label;

  • Goto statement transfers control to a labelled block.

GOTO Label

  • Label is point after processing starts a GOTO is targeted to label.
  • Must follow the rules for identifiers.

Restriction on GOTO statement:

  • Cannot transfer control into IF statement, CASE statement, LOOP statement
  • Cannot transfer control from one IF statement clause to another.
  • Cannot transfer control into an exception handler.
  • Cannot transfer control out of subprogram.

Question 4

Edit

Statement

True-False▾

Trigger syntax declaration without the option for each row is legal

Answer

TRUE

Explanation

  • Trigger syntax declaration without the option for each row is legal.

Trigger

  • A trigger is a special kind of a stored procedure that executes in response to certain action on the table like insertion, deletion or updation of data-it is executed automatically.
  • We can՚t explicitly invoke triggers.

Types of triggers:

After Triggers

  • Run after insert, alter and delete.
  • Three types of AFTER trigger
    • AFTER INSERT Trigger
    • AFTER UPDATE Trigger
    • AFTER DELETE Trigger

    “Instead of” Trigger

  • Use as interceptor for any access to table view.
Types of Triggers in Image

Developed by: