Question
Which of the following is true about triggers in a
relational database?Solution
Triggers are database objects that automatically execute predefined actions in response to specific events, such as INSERT, UPDATE, or DELETE operations. They are used to enforce complex business rules, maintain audit trails, or synchronize tables. For instance, a trigger can automatically log changes to a table in an audit table whenever a record is updated. Triggers are associated with a table or a view and fire without manual intervention, making them ideal for automation. While powerful, they should be used judiciously to avoid performance bottlenecks in high-transaction environments. Why Other Options Are Incorrect :
- Triggers can be manually executed by database administrators : Triggers are event-driven and cannot be executed manually.
- Triggers replace indexes for optimizing queries : Indexes are designed to optimize query performance, while triggers are for automating responses to events.
- Triggers are only used for logging data changes : While logging is a common use case, triggers have broader applications like enforcing business rules.
- Triggers can only be defined for INSERT operations : Triggers can be defined for INSERT, UPDATE, DELETE, or even complex conditions.
Shivank purchased a total of 630 kg of wheat, rice, and pulses in the ratio 3:2:4, respectively. After selling 70% of the wheat, 40% of the rice, and 40...
If three numbers are in the ratio of 1:3:5 and their sum is 9000. Find the largest of the three numbers.
- In a company of 720 employees, the ratio of men to women is 5:4. Among men, the ratio of married to unmarried men is 3:2. Among women, the ratio of married...
- Rs. 42000 is divided among 'Aman', 'Bhanu' and 'Chirag' in such a way such that amount received by 'Aman' is (7/10) of amount received by 'Bhanu' and (7/4)...
The ratio of number of girls to number of boys is 3 : 2 in a class of 60 students. The average marks scored by the boys in Physics is 72 and the average...
The ratio of tea cups to coffee cups in a canteen is 6:5. If 18 tea cups are broken and 12 new coffee cups are added, the count of both becomes equal. F...
The sum of two numbers is 25 and their difference is 15. The ratio of the numbers is:
4%of the selling price of an article is equal to 5% of its cost price. Again 20% of the selling price is Rs.120 more than 22%ofits cost price. The ratio...
- โAโ, โBโ and โCโ divide a certain sum of money among themselves. The average of the amount with them is Rs. 4520. Share of โAโ is 10(2/3)% ...
The sum of three numbers A, B and C is โน11,800. The ratio of Aโs share to Bโs share isย 3 : 4 , and the ratio of Bโs share to Cโs share isย ...