1.SQL语句的分类
- 数据操作语句:DML语句(Data Manipulation Language),包括insert、update、delete。
- 数据查询语句:DQL语句(Data Query Language),包括select。
- 数据控制语句:DCL语句(Data Control Language),包括grant、revoke。
- 数据定义语言:DDL语句(Data Definition Language),包括create、drop、alter、truncate、view、sequence、index、synonym。
INSERT
insert into tab(empno,ename,sal,deptno) values(1001,'Tom',3000,10);
insert into emp values(1001,'Tom',3000,10);
insert into emp10
select * from emp where deptno=10;
DELETE & TRUNCATE
delete from testdelete;
delete from testdelete
where no = 1;
truncate table testdelete;
UPDATE
update tab
set name = '李白',
score = 95
where no = 2;