Difficulty: Easy
Correct Answer: stored procedure
Explanation:
Introduction / Context:
Databases support server-side code for performance, security, and reuse. Two common programmable objects are triggers and stored procedures. They differ by how they are invoked.
Given Data / Assumptions:
Concept / Approach:
A stored procedure is a named program stored in the database, executed by clients or other procedures. A trigger is also stored but fires automatically in response to DML/DDL events; it is not invoked directly by users in normal operation.
Step-by-Step Solution:
Verification / Alternative check:
Examples: PostgreSQL functions, SQL Server stored procedures, Oracle procedures/packages.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming triggers are interchangeable with procedures; triggers are tied to table/view events and execute implicitly.
Final Answer:
stored procedure
Discussion & Comments