mysql数据库的索引类型
发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,索引类型介绍:主键索引primary key() 要求关键字不能重复,也不能为null,同时增加主键约束 主键索引定义时,不能命名唯一索引unique index() 要求关键字不能重复,同时增加唯一
千家信息网最后更新 2024年09月22日mysql数据库的索引类型
索引类型介绍:
主键索引
primary key() 要求关键字不能重复,也不能为null,同时增加主键约束 主键索引定义时,不能命名
唯一索引
unique index() 要求关键字不能重复,同时增加唯一约束
普通索引
index() 对关键字没有要求
全文索引
fulltext key() 关键字的来源不是所有字段的数据,而是字段中提取的特别关键字
关键字:可以是某个字段或多个字段,多个字段称为复合索引。
实例:
建表:creat table student( stu_id int unsigned not null auto_increment, name varchar(32) not null default '', phone char(11) not null default '', stu_code varchar(32) not null default '', stu_desc text, primary key ('stu_id'), //主键索引 unique index 'stu_code' ('stu_code'), //唯一索引 index 'name_phone' ('name','phone'), //普通索引,复合索引 fulltext index 'stu_desc' ('stu_desc'), //全文索引) engine=myisam charset=utf8;更新:alert table student add primary key ('stu_id'), //主键索引 add unique index 'stu_code' ('stu_code'), //唯一索引 add index 'name_phone' ('name','phone'), //普通索引,复合索引 add fulltext index 'stu_desc' ('stu_desc'); //全文索引删除:alert table sutdent drop primary key, drop index 'stu_code', drop index 'name_phone', drop index 'stu_desc';
以上就是mysql索引类型介绍的详细内容,更多请关注其它相关文章!
索引
关键
关键字
字段
普通
全文
类型
同时
多个
数据
内容
实例
就是
文章
更多
来源
而是
更新
数据库
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
安徽数据网络技术代理商
一个数据库的外模式可能有多个
西红柿抢红包软件开发
宜兴计算机网络技术诚信为本
新手可以做手机软件开发吗
设计数据库的字符编码
长春多媒体博物馆软件开发
台式电脑上有一个数据库
plsql数据库备份表
湖北专业软件开发价钱是多少
mc 服务器是什么
在服务器烧烤
企业软件开发的管理
西安在哪里学软件开发
玉树定制软件开发
服务器防护脚本
信息系统监理和网络安全
衢州知名软件开发制作
联想服务器读不到u盘
学生表和成绩表怎么合并数据库
2019三级网络技术题型
csgo服务器脱机
代码输入图片进数据库
mysql数据库误删恢复
标准输入法软件开发
深圳楼控管理软件开发费用
成都才商之道网络技术
刺激战场主播服务器分布
大学网络安全知识竞赛可以改吗
2k20服务器连接失败ps4