-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook.sql
More file actions
35 lines (31 loc) · 1005 Bytes
/
book.sql
File metadata and controls
35 lines (31 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
set serveroutput on;
create table book(accno number primary key,
title varchar(30),
author varchar(30),
publisher varchar(30),
edition_ varchar(20),
no_of_copies number);
create or replace trigger book_modified
after insert or update or delete
on book
declare
nos number;
begin
select count(*) into nos from book;
dbms_output.put_line('modified>>> Tuple count['||nos||']');
end;
/
begin
INSERT INTO book VALUES (112, 'Introduction to Algorithms',
'Thomas H. Cormen', 'MIT Press', '3/E', 10);
INSERT INTO book VALUES (113, 'Operating Systems:
Three Easy Pieces', 'Remzi H. Arpaci-Dusseau', 'Arpaci-Dusseau', '1/E', 15);
INSERT INTO book VALUES (114, 'Database Management Systems',
'Raghu Ramkrishnan', 'McGraw Hill', '2/E', 8);
update book set no_of_copies=20 where accno=112;
delete from book where accno=114;
delete from book;
commit;
end;
/
drop table book;