CARVIEW |
Select Language
HTTP/2 200
date: Tue, 14 Oct 2025 05:52:38 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=6912693db4df510fbb336fcfe7beb3ba3796b700ffffd2a5b5979d5dd5ed16c0a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22-lld6uxN0tl9xdXIMzCj7N6s_zD14Ylm%22%3B%7D; HttpOnly; Path=/
cf-ray: 98e4cfcddc22c179-BLR
DBMSL Ass 7A - Library Trigger - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE Library (
- book_id NUMBER PRIMARY KEY,
- book_name VARCHAR2(100),
- book_author VARCHAR2(100)
- );
- CREATE TABLE Library_Audit (
- event_time TIMESTAMP,
- book_id NUMBER PRIMARY KEY,
- book_name VARCHAR2(100),
- book_author VARCHAR2(100),
- remarks VARCHAR2(500)
- );
- INSERT INTO Library VALUES (001, 'Computer Architecture (7th ed.)', 'Patterson and Hennessey');
- INSERT INTO Library VALUES (002, 'Introduction to Linear Algebra (2nd Ed.)', 'Gilbert Strang'); -- update to 5th edition
- INSERT INTO Library VALUES (003, 'Automata Theory (1st Ed.)', 'Ulman'); -- update to 2nd edition
- INSERT INTO Library VALUES (004, 'Operating System Concepts (8th Ed.)', 'Silberschatz');
- INSERT INTO Library VALUES (005, '1984', 'George Orwell'); -- delete book
- INSERT INTO Library VALUES (006, 'Digital Logic (3rd Ed.)', 'Morris Mano'); -- update to 6th edition
- INSERT INTO Library VALUES (007, 'Alice in Wonderland', 'Lewis Caroll'); -- delete book
- INSERT INTO Library VALUES (008, 'Database System Concepts (7th Ed.)', 'Korth');
- CREATE OR REPLACE TRIGGER updateTrigger AFTER UPDATE
- ON Library FOR EACH ROW
- BEGIN
- INSERT INTO Library_Audit VALUES (
- SYSTIMESTAMP,
- :OLD.book_id,
- :OLD.book_name,
- :OLD.book_author,
- 'Updated'
- );
- END;
- CREATE OR REPLACE TRIGGER deleteTrigger AFTER DELETE
- ON Library FOR EACH ROW
- BEGIN
- INSERT INTO Library_Audit VALUES (
- SYSTIMESTAMP,
- :OLD.book_id,
- :OLD.book_name,
- :OLD.book_author,
- 'Removed'
- );
- END;
- DELETE FROM Library WHERE book_id = 005;
- UPDATE Library
- SET book_name = 'Introduction to Linear Algebra (5th Ed.)'
- WHERE book_id = 002;
- UPDATE Library
- SET book_name = 'Automata Theory (2nd Ed.)'
- WHERE book_id = 003;
- DELETE FROM Library WHERE book_id = 007;
- UPDATE Library
- SET book_name = 'Digital Logic (6th Ed.)'
- WHERE book_id = 006;
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 5 sec ago | 0.15 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 16 sec ago | 0.15 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 26 sec ago | 0.15 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 37 sec ago | 0.15 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 48 sec ago | 0.15 KB
-
⭐⭐⭐Profit Method⭐⭐
Java | 58 sec ago | 0.15 KB
-
⭐⭐⭐Instant Profit Method⭐⭐
Java | 1 min ago | 0.15 KB
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 1 min ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand