立即学习:https://edu.csdn.net/course/play/27328/362532?utm_source=blogtoedu

没有索引:全表扫描,效率低

学习笔记(14):MySQL数据库从入门到搞定实战-索引的基本使用

 1、创建索引

创建普通索引:

creat index indexName on tableName(columnName(length));

创建唯一索引:

creat unique index indexName on tableName(columnName(length));

创建复合索引:

creat index indexName on tableName(columnName1,columnName2......);

删除索引:

drop index [indexName] on tableName;

查看索引:

show index from tableName;

相关文章:

  • 2021-08-05
  • 2021-03-31
  • 2021-04-02
  • 2021-08-09
  • 2022-12-23
  • 2021-08-02
  • 2021-05-31
  • 2021-12-31
猜你喜欢
  • 2021-09-27
  • 2021-04-08
  • 2021-08-26
  • 2021-10-28
  • 2021-10-27
  • 2021-09-29
  • 2021-08-12
相关资源
相似解决方案