file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E0.tmp.jpg file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E1.tmp.jpg 1、查询1833班信息的2,4行的数据 select * from student where class=1833 limit 1,3; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E2.tmp.jpg 2、显示班级为空的id和姓名、和数学分数 select id,name,math from student where class is null; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E3.tmp.jpg 3、统计每个班级人数 mysql> select class, count(*)from student group by class; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E4.tmp.jpg 4、最1833班数学成绩最大的ID年龄和姓名 mysql> select id,age,name from student where class=1833 and math=(select max(math)from student where class=1833); file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E5.tmp.jpg 5、求数学分最小的班级 ID年龄和姓名 mysql> select class,id,age,name from student where math=(select min(math) from student); file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E6.tmp.jpg 6、求1833班数学分总和 mysql> select sum(math)from student where class=1833; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74E7.tmp.jpg 7、求所有班级分数总和 mysql> Select sum(math)from student; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74F8.tmp.jpg 8、求年纪最大的班级并显示班级年龄和姓名分数 mysql> select class,age,name,math from student where age=(select max(age)from student); file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74F9.tmp.jpg 9、统计sex1和0个总数 mysql> select sex,count(*)from student group by sex; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FA.tmp.jpg 10、求出所有班级年纪平均数 mysql> select avg(age)from student; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FB.tmp.jpg 11、求出1835班年纪的平均数 mysql> select avg(age) from student where class=1835; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FC.tmp.jpg 12、求出1833班年纪的平均数 mysql> select avg(age) from student where class=1833; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FD.tmp.jpg 13、将所有数据按照年纪进行降序后显示年纪姓名和班级 mysql> select age,name,class from student order by age desc; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FE.tmp.jpg 14、将所有数据按照年纪升序显示年纪姓名班级和数学分数 mysql> select age,name,class,math from student order by age; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps74FF.tmp.jpg 15、按照班级将进行分组 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7500.tmp.jpg 16、根据age字段进行降序排序; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7510.tmp.jpg 17、根据math字段进行升序排序,并显示前5行所有数据; file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7511.tmp.jpg 18、把lisi的数学成绩改为69分 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7512.tmp.jpg 19、查找性别不为1的所有数据 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7513.tmp.jpg 20、只显示表中姓名,且将相同的姓名名称去重 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7514.tmp.jpg 21、统计表中行数 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7515.tmp.jpg 22、统计年纪在27岁的有多少 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7516.tmp.jpg 23、统计年纪大于25小于35的有多少 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7517.tmp.jpg 24、求数学分总和 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7518.tmp.jpg 25、求分数最小 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps7519.tmp.jpg 26、求平均分 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps752A.tmp.jpg 27、只显示3-8行的数据 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps752B.tmp.jpg 28、查找姓名尾号为qi的所有数据 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps752C.tmp.jpg 29、查询姓名开头为xiao的所有数据 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps752D.tmp.jpg 30、查询中间值为ao开头的所有数据 file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps752E.tmp.jpg
|