关系数据库的标准语言是:结构化查询语句(SQL)
SQL分为四类:
1.DQL(数据查询语言)
关键字:select
举例:select * from c_student;
2.DDL(数据定义语言)
关键字:create,alter,drop
举例:
--create
create table STUDENT(
id number primary key,
name varchar2(100),
sex varchar2(3),
age number,
address varchar2(1000)
);
--alter
alter table student add (classId number);
--drop
drop table STUDENT;
3.DML(数据操纵语言)
关键字:insert,update,delete
--insert
insert into student(id,name,sex,age,address) values(1,'无心','1',17,'寒水寺');
--update
update student t set t.address = '天外天' where t.id = 1;
--delete
delete from student t where t.id = 1;
4.DCL(数据控制语言)
关键字:grant,revoke
举例:
--grant
--给所有用户向STUDENT表插入的权限
grant insert on STUDENT to public;
--revoke
--收回test用户向STUDENT表插入的权限
revoke insert on STUDENT from test;