Professional Documents
Culture Documents
Presentation
Topic: Trigger & Functions in DBMS
Presented to, Md Kawsar Ahmed
(Lecturer)
Dept. of CSE
R.P. Shaha University
Introduction
Introductio Trigger
01 02 1. What is trigger?
n 2.
3.
Types of trigger
Examples
Conclusion
Functions
03 1.
2.
What is Functions
Types of Functions
04 s 1. Any Question
2. Thank you
3. Examples
Trigger
What is Trigger in DBMS ?
...
CREATE TRIGGER [Schema_name] Trigger_name DML
ON { table_name } Trigg
er
(AFTER|BEFOR) { [INSERT] [,] [UPDATE] [,]
[DELETE] }
[NOT FOR REPLICATION]
AS { SQL_statement }
Example
There, we have two tables. Let’s use triggers
in them.
Trigg
er Table
s
...
Example
Appl
y In
Trigg sert
er
...
In p u t
Outp
ut
...
Output For Both Table
Functions
What is Functions ?
> Functions in SQL are the database objects that contains a set
of SQL statements to perform a specific task. function
accepts input parameters, perform actions, and then return the
result
RETURNS data_type AS
BEGIN
statements
RETURN value
END
Example
Scalar User-defined Function
Example
Using my function in my table
Output
Thank You
Any Question?
Reference
1. SQL Server Functions – javatpoint
s: 2. Chat-gpt : ChatGPT (openai.com)
3. Bard (google.com)
4. SQL Tutorial (w3schools.com)
5. Anaheim Font - 1001 Free Fonts
6. Triggers in DBMS: What They Are and How to Use Them (geopits.com)