一、创建索引
create table student(
sid int primary key,
card_id varchar(20),
name varchar(20),
gender varchar(20),
age int,
birth date,
phone_num varchar(20),
score double,
index index_name(name) -- 给name列创建索引
);
select * from student where name ='张三';
2.直接创建:
create index index_gender on student(gender);
3.修改表结构添加索引
alter table student add index index_age(age);
– 查看索引: