Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
31. Triggers in SQL | Sql Triggers🔫 Real Life Example
Play lesson

AWS DATA ENGINEERING - 31. Triggers in SQL | Sql Triggers🔫 Real Life Example

4.0 (0)
11 learners

What you'll learn

This course includes

  • 18.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Sql Triggers🔫 Real Life Example A trigger in SQL is a set of instructions that automatically execute in response to specific events on a particular table or view. Triggers are typically used to enforce business rules, maintain audit trails, and automate tasks such as calculations or updates when changes are made to a database. Trigger Types BEFORE Trigger: Executes before an operation (INSERT, UPDATE, or DELETE) is completed. AFTER Trigger: Executes after an operation is completed. INSTEAD OF Trigger: Typically used on views to handle what happens instead of a default INSERT, UPDATE, or DELETE action. Want more similar videos- hit like, comment, share and subscribe ❤️Do Like, Share and Comment ❤️ ❤️ Like Aim 5000 likes! ❤️ ➖➖➖➖➖➖➖➖➖➖➖➖➖ script CREATE TABLE Employee ( employee_id INT PRIMARY KEY, employee_name VARCHAR(50), department_id INT, salary DECIMAL(10, 2) ); CREATE TABLE Backup_Employee ( backup_id INT IDENTITY(1,1) PRIMARY KEY, employee_id INT, employee_name VARCHAR(50), department_id INT, salary DECIMAL(10, 2), deleted_at DATETIME DEFAULT GETDATE() ); CREATE TRIGGER employee_delete ON Employee AFTER DELETE AS BEGIN INSERT INTO Backup_Employee (employee_id, employee_name, department_id, salary, deleted_at) SELECT employee_id, employee_name, department_id, salary, GETDATE() FROM DELETED; END; ➖➖➖➖➖➖➖➖➖➖➖➖➖ AWS DATA ENGINEER : https://www.youtube.com/playlist?list=PLOlK8ytA0MghpdMjb0m9zu1v9s_qbRP0q Azure data factory : https://youtube.com/playlist?list=PLOlK8ytA0MgguN5XidtQXbILxwCdJCUJE&si=iEICXHP80zGchUYh Azure data engineer playlist : https://youtube.com/playlist?list=PLOlK8ytA0MghBrzu0i6WlTBdoO1WdwV_e SQL PLAYLIST : https://www.youtube.com/playlist?list=PLOlK8ytA0MggGXIKmbfZ-_Xqcos3JKdV- PYSPARK PLAYLIST - https://www.youtube.com/playlist?list=PLOlK8ytA0MgjvOpd-088NRU_vTYw_aryH ➖➖➖➖➖➖➖➖➖➖➖➖➖ 📣Want to connect with me? Check out these links:📣 Join telegram to discuss https://t.me/+Cb98j1_fnZs3OTA1 ➖➖➖➖➖➖➖➖➖➖➖➖➖ what we have covered in this video: ➖➖➖➖➖➖➖➖➖➖➖➖➖ Hope you liked this video and learned something new :) See you in next video, until then Bye-Bye! ➖➖➖➖➖➖➖➖➖➖➖➖➖

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere