SQL Triggers MCQ Questions
11. The variables in the triggers are declared using
A. -
B. @
C. #
D. $
View Answer
Ans : B
Explanation: Example : declare @empid int; where empid is the variable.
12. The default extension for an Oracle SQL*Plus file is:
A. .txt
B. .html
C. .css
D. .sql
View Answer
Ans : D
Explanation: The default extension for an Oracle SQL*Plus file is .sql
13. What are the different in triggers?
A. Define, Create
B. Drop, Comment
C. Insert, Update, Delete
D. All of the mentioned
View Answer
Ans : C
Explanation: Triggers are not possible for create, drop.
14. Which prefixes are available to Oracle triggers?
A. : new only
B. : old only
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: Both A and B prefixes are available to Oracle triggers.
15. Triggers ________ enabled or disabled
A. Can be
B. Cannot be
C. Ought to be
D. Always
View Answer
Ans : A
Explanation: Triggers can be manipulated
16. Trigger is special type of __________ procedure.
A. Function
B. Stored
C. View
D. Table
View Answer
Ans : B
Explanation: Triggers are used to assess/evaluate data before or after data modification using DDL and DML statements.
17. Point out the correct statement.
A. Triggers are database object
B. Three types of triggers are present in SQL Server
C. A DDL trigger is an action programmed to execute when a data manipulation language (DML) event occurs in the database server
D. None of the mentioned
View Answer
Ans : A
Explanation: Triggers are special type of stored procedure that automatically executes when a DDL or DML statement associated with the trigger is executed.
18. How many types of triggers are present in SQL Server?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : C
Explanation: In Sql Server we can create four types of triggers Data Definition Language (DDL) triggers, Data Manipulation Language (DML) triggers, CLR triggers and Logon triggers.
19. How many types of DML triggers are present in SQL Server?
A. 4
B. 5
C. 6
D. 7
View Answer
Ans : B
Explanation: We have two types of DML triggers-AFTER and INSTEAD OF.
20. Point out the wrong statement.
A. We can have an INSTEAD OF insert/update/delete trigger on a table that successfully executed
B. DML Triggers are used to evaluate data after data manipulation using DML statements
C. INSTEAD OF triggers cause their source DML operation to skip
D. AFTER triggers cause their source DML operation to skip
View Answer
Ans : D
Explanation: INSTEAD OF triggers cause their source DML operation to skip and they just execute the code provided inside them.
Discussion