chengxuyuanzrc

第一种方式:在执行create table时创建索引

 

create table user_index(

     id  int  auto_increment   primary key,

     first_name   varchar(16),

     last_name   varchar(16),

     id_card        varchar(18),

     information   text(225),

     key    name( first_name,last_name),

    fulltext   key(information),

    unique key(id_card)

);

第二种方式:使用Alter table命令去增加索引

alter table table_name add index  index_name(column_list);

第三种方式:使用create index命令来创建

create index index_name on table_name(column_list);

 

删除索引的方式有:

根据索引名来删除普通索引、唯一索引、全文索引。

alter table 表名  drop key 索引名

 

分类:

技术点:

相关文章:

  • 2022-03-02
  • 2021-12-04
  • 2021-11-19
  • 2021-10-31
  • 2021-11-25
  • 2021-12-25
  • 2021-06-07
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案