-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp280.sql
More file actions
60 lines (42 loc) · 799 Bytes
/
p280.sql
File metadata and controls
60 lines (42 loc) · 799 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
select * from tabs;
drop table DEPT1;
select * from dept1;
create table dept1
as
select * from dept; --dept 테이블의 컬럼 및 데이터를 복제하여 dept1 테이블 생성
update dept1
set loc = 'BUSAN'
where deptno = 30;
update dept1
set (dname, loc) = (
select dname, loc
from dept
where deptno = 30
)
where deptno = 30;
update dept1
set loc = 'SEOUL'
where deptno = (
select deptno
from dept1
where dname = 'SALES'
);
--삭제
delete
from dept1
where deptno = 40;
select * from dept1;
rollback;
commit;
--emp1 테이블 복제
select * from emp1;
create table emp1
as
select * from emp;
delete
from emp1
where empno in(
select e.empno
from emp1 e, salgrade s
where e.sal between s.losal and s.hisal and s.grade = 3 and deptno = 30
);