Skip to content

Sana-aafreen/task4-SQL-Internship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

task4-SQL-Internship

πŸ—‚οΈ SQL Developer Internship - Task 4: Triggers for Auditing

πŸ“Œ Objective

The goal of this task is to track INSERT, UPDATE, and DELETE operations on a table using triggers and record these changes into an audit log table.
This ensures that every modification in the database is monitored for auditing and accountability.


πŸ”‘ Key Concepts

  • Triggers β†’ Special stored programs that execute automatically on INSERT/UPDATE/DELETE events.
  • BEFORE & AFTER triggers β†’ Control whether logic runs before or after the event.
  • NEW & OLD references β†’ Provide access to row values before and after changes.
  • Auditing β†’ Keeping a history of what data was changed, when, and by whom.

πŸ—οΈ Schema Design

1. Main Table: employees

CREATE TABLE employees (
    emp_id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100),
    department VARCHAR(50),
    salary DECIMAL(10,2)
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published