1. A trigger will display the message "Student record modified successfully" whenever any record is modified in the STUDENT_DETAILS table.
2. A trigger will display the message "New employee record inserted" whenever a new record is inserted into the WORKS table.
3. A trigger will insert records into the STUDENT_DETAILS table only if the age is greater than 18. If the age is less than 18, an appropriate message will be returned to the console.
1. A trigger will display the message "Student record modified successfully" whenever any record is modified in the STUDENT_DETAILS table.
2. A trigger will display the message "New employee record inserted" whenever a new record is inserted into the WORKS table.
3. A trigger will insert records into the STUDENT_DETAILS table only if the age is greater than 18. If the age is less than 18, an appropriate message will be returned to the console.
1. A trigger will display the message "Student record modified successfully" whenever any record is modified in the STUDENT_DETAILS table.
2. A trigger will display the message "New employee record inserted" whenever a new record is inserted into the WORKS table.
3. A trigger will insert records into the STUDENT_DETAILS table only if the age is greater than 18. If the age is less than 18, an appropriate message will be returned to the console.
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.