Skip to content

Commit f2c2986

Browse files
authored
Merge branch 'main' into resolve-conflict
2 parents 3e18cca + 7e2bc11 commit f2c2986

File tree

390 files changed

+2847
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+2847
-200
lines changed

data-manipulation/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CREATE TABLE IF NOT EXISTS Student_Audit_Log (
2+
id INT AUTO_INCREMENT PRIMARY KEY,
3+
student_id INT,
4+
action VARCHAR(255) NOT NULL,
5+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
6+
);
7+
8+
DROP TRIGGER IF EXISTS after_student_insert;
9+
DROP TRIGGER IF EXISTS after_student_update;
10+
DROP TRIGGER IF EXISTS after_student_delete;
11+
12+
DELIMITER //
13+
CREATE TRIGGER after_student_insert
14+
AFTER INSERT ON Student
15+
FOR EACH ROW
16+
BEGIN
17+
INSERT INTO Student_Audit_Log(student_id, action)
18+
VALUES (NEW.id, 'INSERT');
19+
END//
20+
21+
CREATE TRIGGER after_student_update
22+
AFTER UPDATE ON Student
23+
FOR EACH ROW
24+
BEGIN
25+
INSERT INTO Student_Audit_Log(student_id, action)
26+
VALUES (NEW.id, 'UPDATE');
27+
END//
28+
29+
CREATE TRIGGER after_student_delete
30+
AFTER DELETE ON Student
31+
FOR EACH ROW
32+
BEGIN
33+
INSERT INTO Student_Audit_Log(student_id, action)
34+
VALUES (OLD.id, 'DELETE');
35+
END//
36+
DELIMITER ;

0 commit comments

Comments
 (0)