当前位置:网站首页>MySql 创建索引
MySql 创建索引
2022-07-30 20:15:00 【m0_66557301】






– (1)自动创建索引
– 创建表index_book并为其添加索引(创建主键和唯一约束)
create table index_book(
id int(8) primary key auto_increment,
name varchar(20),
price float(3),
date varchar(20)
)
# 查看index_book中的索引
– 语法: show index from 表名
show index from index_book
– (2)手动创建索引
# 创建表index_book1给id添加索引
create table index_book1(
id int(8) ,
name varchar(20),
price float(3),
date varchar(20),
index(id)
)
# 创建表index_book2给sname添加唯一索引
create table index_book2(
id int(8) ,
sname varchar(20),
price float(3),
date varchar(20),
unique index(sname)
)
– (3)主键创建索引
# 创建表index_book3给id添加主键索引
create table index_book3(
id int(8) ,
sname varchar(20),
price float(3),
date varchar(20),
primary key (id)
)
– (4)全文创建索引
#创建表index_book4给info添加索引
create table index_book4(
id int(8) ,
sname varchar(20),
price float(3),
date varchar(20),
info varchar(200),
fulltext index(info)
)
– (5)空间索引的创建
– 注: 空间类型数据添加值不能为空 not null
#创建表index_book5给sook字段类型为point添加索引
create table index_book5(
id int(8) ,
sname varchar(20),
price float(3),
date varchar(20),
sook point not null,
spatial index(sook)
)
– (6)复合索引的创建
#创建表index_book6给id和date添加复合索引
create table index_book6(
id int(8) ,
sname varchar(20),
price float(3),
date varchar(20),
index(id,date)
)
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- Face-based Common Expression Recognition (2) - Data Acquisition and Arrangement
- HarmonyOS Notes ------------- (3)
- 如何优化OpenSumi终端性能?
- 是对称矩阵的对角化
- 银行数据资产转换能力弱?思迈特软件助力解决银行困境
- 推荐系统:AB测试(AB Test)
- 并发与并行的区别
- MySQL 视图(详解)
- MySQL kills 10 questions, how many questions can you stick to?
- 推荐系统:评估指标【离线评估指标:RMSE(均方根误差)、AUC、准确率、召回率、F1】【在线评估:A/B测试】【一般要求响应时间<0.5s】
猜你喜欢

ECCV2022 | 对比视觉Transformer的在线持续学习

18.客户端会话技术Cookie
![Recommendation system: evaluation index [offline evaluation index: RMSE (root mean square error), AUC, precision, recall, F1] [online evaluation: A/B test] [generally required response time <0.5s]](/img/ff/9c49d38a655e3f7f221b219d5069c9.png)
Recommendation system: evaluation index [offline evaluation index: RMSE (root mean square error), AUC, precision, recall, F1] [online evaluation: A/B test] [generally required response time <0.5s]
![[Node implements data encryption]](/img/8b/f9ff44c39fc9e80b2f2d2626a74076.png)
[Node implements data encryption]

TensorFlow2: Overview
![[PM only] Quickly count who else in the team has not registered and reported information, and quickly screen out the members of their own project team who have not completed the list of XXX work items](/img/74/94c254b7694a77d635f5f538a72fe0.png)
[PM only] Quickly count who else in the team has not registered and reported information, and quickly screen out the members of their own project team who have not completed the list of XXX work items

KEIL问题:【keil Error: failed to execute ‘C:\Keil\ARM\ARMCC‘】

MySQL performance optimization (hardware, system configuration, table structure, SQL statements)

如何优化OpenSumi终端性能?

MySQL的主从复制
随机推荐
【元胞自动机】基于元胞自动机模拟生命演化、病毒感染等实例附matlab代码
halcon——轮廓线
ELK log analysis system
“数字化重构系统,搞定 CEO 是第一步”
Common Expression Recognition Based on Face (1) - Basic Knowledge of Deep Learning
M3SDA: Moment matching for multi-source domain adaptation
TensorFlow2: Overview
使用MULTISET来比较数据集的实例介绍
【Codeforces思维题】20220728
Install MySQL tutorial under Linux
Redisson 的分布式锁找不到?
mysqldump导出提示:mysqldump [Warning] Using a password on the command line interface can be insecure
TensorFlow2:概述
Recommendation System - Sorting Layer: Sorting Layer Architecture [User and Item Feature Processing Steps]
4年测试经验去面试10分钟就被赶出来了,面试官说我还不如应届生?都这么卷吗...
时间复杂度与空间复杂度
【luogu P8031】Kućice(计算几何)
Flink_CDC搭建及简单使用
Can't find the distributed lock of Redisson?
MySql密码