--隨堂練習(P272-1)
update emp
set comm=0
where comm is null
select * from emp
go
--隨堂練習(P272-2)
update emp
set sal=sal * 1.05
where deptno=(select deptno
from dept
where dname = 'research')
select * from emp
go
--隨堂練習(P277-1)
delete from item
where ordid = 620
delete from ORD
where ORDID = 620
select * from ORD
go
--隨堂練習(P277-2)
--"="後面只能等於一個值,所以這邊要用in 或 = any
delete from ITEM
where ORDID = any(select ORDID
from ORD
where CUSTID=106)
select * from ITEM
go
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。