What is the purpose of a trigger in a database? MCQ with Answer and Explanation

What is the purpose of a trigger in a database?
A. To create a backup
B. To automatically execute a set of actions in response to certain events on a table
C. To index a column
D. To join tables
Answer: Option B
Solution (By JKSSB Mock Tests)
A trigger is a stored program that automatically runs when a specified event (INSERT, UPDATE, DELETE) occurs on a table.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
What kind of lock allows multiple concurrent transactions to read a database row simultaneously but blocks any transaction from writing to it?
A. Shared Lock
B. Deadlock
C. Exclusive Lock
D. Intent Lock

Correct Answer: Option A


Explanation:
A Shared Lock (S-lock) permits concurrent transactions to read a resource but prevents any modification operations until the lock is released.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which of the following is a valid SQL string function?
A. SUBSTRING
B. All of the above
C. CONCAT
D. REPLACE

Correct Answer: Option B


Explanation:
SUBSTRING, CONCAT, and REPLACE are common string functions in SQL.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which of the following describes a precompiled collection of SQL statements stored on the database server that can be executed repeatedly by name?
A. Cursor
B. Stored Procedure
C. Trigger
D. View

Correct Answer: Option B


Explanation:
A Stored Procedure is a precompiled group of SQL statements and optional control-of-flow code stored in the database server, enhancing execution speed and security.

This question belongs to: Computer Database Management System (DBMS)