Database-MySQL [PCS Infotech Placement]: Sample Questions 14 - 15 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 14

Edit

Statement

True-False▾

DDL can be used in trigger

Answer

TRUE

Explanation

Understanding of DDL Triggers
  • DDL triggers fire in response to a variety of Data Defination Language events.
  • The events primarily correspond to Transact-SQL statement- CREATE, ALTER, DROP, GRANT, DENY, REVOKE or UPDATE statistics.
  • Used to perform administrative task and enforce business rules.
  • Apply to all commands of a single type on a database or a server.

Types of DDL Trigger:

  • Transact-SQL DDL Trigger:
    • Stored procedure that execute one or more SQL statements in response to a server-scoped event.
    • A DDL Trigger fires if a statement such as ALTER SERVER CONFIGURATION is executed.
  • CLR DDL Trigger:
    • Executes one or more methods written in managed code with members created in the . NET framework.
Types of DDL Trigger
  • Fires only after the DDL statements that trigger are run.
  • DDL triggers cannot use “INSTEAD OF” triggers.
  • Create the special inserted and deleted table.
  • Multiple triggers created for each event.

Question 15

Edit

Statement

True-False▾

A package without body is possible

Answer

TRUE

Explanation

Advantages of Using Packages
  • Package without body declares global cursor and constant that can use by other function, procedures or packages.
  • Procedures in body are private subprograms accessible only by subprograms inside the package not from outside.
  • If public item includes cursors or subprograms, then the package must have a body.
  • The body defines queries for public cursor and code for public subprogram.

Use of Packages

  • Modularity
  • Easier application design
  • Hidden implementation details
  • Added functionality
  • Better Performance
  • Easier to Grant Roles

Developed by: