PCS Infotech Papers: Sample Questions 15 - 16 of 25

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 15

» Database » MySQL

True-False▾

Question

Is the Following Statement True or False?

A trigger name can have the same name as that of its base table name

Answer

TRUE

Explanation

  • Trigger name must be unique with respect to other triggers in the same schema.

  • Need not be unique with respect to other schema objects, table, and subprograms.

  • For eg. , a table and a trigger can have the same name.

  • Trigger doesn’t share the same namespace as table.

  • Functions, procedures, table etc. share the same namespace.

Question number: 16

» Database » MySQL

True-False▾

Question

Is the Following Statement True or False?

DDL can be used in trigger

Answer

TRUE

Explanation

Understanding of DDL triggers

Understanding of DDL Triggers

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

Types of DDL Trigger

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.