三亩地 三亩地SAN MU DI · CODE DIARY
ARTICLE DETAIL

日记详情

真实记录编程学习的某一天,欢迎挑你感兴趣的翻一翻。

MySQL数据库基础-2026-5-11-上五下两节课-索引

MySQL数据库基础-2026-5-11-上五下两节课-索引

– 统计表中总数据量
select count(*) from student;

– 唯一索引查询:student_no列有唯一索引
select * from student where student_no = ‘2025021027’;

– 普通索引查询:student_name列有普通索引
select * from student where student_name = ‘学生_21035’;

– 无索引查询:email列没有建立索引
select * from student where email = ‘student_21035@qq.com’;

– 主键索引查询:id列是主键(自带主键索引)
select * from student where id = 9527;

← 返回列表