数据库SQL特点数据查询,数据操纵,数据定义,数据控制

时间:2025-04-18 10:09:21

数据查询(DQL):select

数据定义(DDL):create,drop,alter

数据操纵(DML):insert,update,delete

数据控制(DCL):grant,revoke

1)建立索引

普通索引

create index stusex on student(ssex);
create index stusexandname on student(ssex,sname);//多列的

唯一索引

create unique index stusno on student(sno);

删除索引

drop index lhh666 on lhh;

显示索引

show index from lhh;

2)创建表,修改表

create table xxx
(xno int primary key,
xname char(20) not null unique,
xscore int(5) default 6);
alter table lhh
add lsex char(66);