sql创建索引
来源:互联网 发布:淘宝联盟怎么赚钱的 编辑:程序博客网 时间:2024/06/05 01:53
-- 创建索引
-- create index 索引名 on 表名(列名);括号里跟要加索引的列名
-- 删除索引
-- drop index 索引名 on 表名;
drop index userAdress on indextable
-- 在创建表的时候创建索引
create table indexTable(
userId int auto_increment,
userName VARCHAR(50) not null,
PRIMARY KEY (userId),
index (userName)
)
-- 查看索引
show index from indextable
-- 如何修改表
-- 添加索引
alter table 表名 add index(列名);
alter table indexTable add index (userAddress)
-- 删除索引
alter table 表名 drop index 索引名;
alter table indexTable drop index userName
-- 查看表的详细信息
explain SELECT * from indextable where userName='lisi';
-- 创建多列普通索引
-- CREATE INDEX 索引名 ON 表名 (列名1,列名2);这里索引名一样
CREATE INDEX index_pwd_address ON indextable (userPwd,userAddress)
阅读全文
0 0
- 中级SQL:创建索引
- 中级SQL:创建索引
- SQL Server创建索引
- SQL创建索引
- sql 创建全文索引
- 创建SQL全文索引
- 创建SQL全文索引
- SQL语句-创建索引
- SQL Server创建索引
- SQL Server创建索引
- SQL创建索引
- SQL Server创建索引
- SQL语句-创建索引
- 中级SQL:创建索引
- Sql Server创建索引
- T-Sql 索引创建
- SQL Server创建索引
- SQL创建索引
- 利用51单片机实现LED闪烁
- HDU 4135 Co-prime
- sql流程控制语句
- 机器学习(5)-支持向量机_Support Vector Machines
- react 函数参数的传递
- sql创建索引
- Spring IOC源码 个人初探(一) BeanFactory
- log4j.properties,log4j.xml配置文件的配置示例
- Struts2 xml 详解
- 关于BeanUtil的理解与小节
- sql进阶部分语句整理
- Oracle PL/SQL开发基础(第二十六弹:游标变量)
- [开源笔记] 第一个开源项目
- Ubuntu 下配置opencv3.2.0 +QT5.9.1