You are on page 1of 4

NAME=NAMAN KUMAR SINGH

REG.NO=19BCE1025

Programme : B.Tech (ECM and CSE) Semester : Winter 2020


Database Management Systems
Course : Code : CSE2004
(Embedded Lab)
Faculty : Dr. Suganthi and Prof.Jayavignesh Slot : L13 + L14

Ex. 10. Triggers

Perform the following tasks with the help of triggers.

 Table name: STUDENT_DETAILS

Fields: Student_Name, Register no, School, course, Student_email,


Student_mobile_no, Date_of_birth, Age

 Table name: WORKS

Fields: Emp_ID , Employee_Name, Company_Name, Salary, Date of joining

1. Write a trigger construct to display the message ‘Student record modified


successfully’ whenever any record is modified in the relation
‘STUDENT_DETAILS’.
2. Write a trigger construct to display the message ‘New employee record inserted’
whenever any new record is inserted in the relation ‘WORKS’.

3. Write a trigger construct to insert records in to the relation ‘STUDENT_DETAILS’


bearing the condition that age is strictly greater than 18. If the age is less than 18,
return appropriate message to the console.
4. Write a trigger construct to increase the salary of employees who company name is
‘Amazon’. During updation, check whether the updated salary is greater than the
earlier salary.

You might also like