Database [PCS Infotech Placement]: Sample Questions 5 - 6 of 25

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 5

Database
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

Question 6

Database
Edit

Write in Short

Short Answer▾

How to write single quote in SQL?

Explanation

  • A single quote contains actual data to be inserted.
  • Single quote with two quotes it not the double quote character but two single-quote characters.
  • The single quote character is reserved for inserting information into a database and if a single quote is contained in data, the command become corrupted.
  • So solve the problem, simply replace any single quote with two quotes.
  • Bellow sample command performs replacement automatically:
    • sContent = Replace (sContent, “′” , “′ ′” )
    • where sContent contains the data that needs single quotes replaced

Developed by: