赞
踩
Tips:之前查看网上的文章感觉太乱了,所以自己整理了一套sql语句来练习,主要也可以拿来应对面试,需要的可以自行下载练习
包含基本语句、聚合函数、模糊查询、范围查询、排序、聚合、分组、分页、子查询、索引和视图、左右连接、双表连接练习语句等
学生表、分数表、班级表还有练习sql语句: 百度网盘
链接: 提取码: 0000
下载之后选择数据库右键–运行SQL文件,3个文件依次运行
select sex,avg(age) from students_01 where age>=15 group by sex;
select * from students_01 where id in(select id from score_01 where score_01.`英语` > 80);
select * from students_01 inner join score_01 on students_01.id=score_01.id having score_01.`英语`>80 order by score_01.` 英语`;
select * from students_01,score_01 where students_01.id=score_01.id and name="赵杰";
select students_01.name,students_01.sex,score_01.`数学` from students_01 inner join score_01 on students_01.id=score_01.id where sex="男" ORDER BY `数学` desc limit 1
select students_01.name,students_01.sex,score_01.`语文` from students_01 inner join score_01 on students_01.id=score_01.id where sex="女" ORDER BY `语文` desc limit 1
select * from students_01 inner join score_01 on students_01.id=score_01.id inner join class_01 on score_01.class_num=class_01.id ORDER BY `数学`;
Tips(重点掌握,面试大部分考核语句):
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。