-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_remove_some_records.sql
More file actions
43 lines (42 loc) · 1.3 KB
/
add_remove_some_records.sql
File metadata and controls
43 lines (42 loc) · 1.3 KB
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
36
37
38
39
40
41
42
43
clear screen
set serveroutput on size unlimited
-- add some options
insert into colors (color) values ('orange')
/
insert into fillings (filling) values ('dotted')
/
insert into items (item) values (4)
/
insert into shapes (shape) values ('square')
/
--remove some options
delete from colors where color = 'red'
/
delete from fillings where filling = 'striped'
/
delete from items where item = 2
/
delete from shapes where shape = 'diamond'
/
commit
/
drop table hand purge
/
create table hand as (
select *
from (select 1 cardno, 'oval' symbol, 'red' color, 'outline' shading, 2 qty from dual
union all
select 2,'squiggle', 'purple', 'closed', 1 from dual union all
select 3,'diamond', 'red', 'closed', 3 from dual union all
select 4,'squiggle', 'green', 'closed',3 from dual union all
select 5,'diamond', 'red', 'striped', 1 from dual union all
select 6,'oval', 'purple', 'striped', 1 from dual union all
select 7,'oval', 'red', 'outline',1 from dual union all
select 8,'oval', 'purple', 'outline',1 from dual union all
select 9,'oval', 'green', 'closed',2 from dual union all
select 10,'oval', 'purple', 'closed',1 from dual union all
select 11,'oval', 'red', 'outline',3 from dual union all
select 12,'diamond', 'purple', 'striped',1 from dual
)
)
/