1、如何将 hellodb_innodb.sql导入到数据库中
方法1:mysql -uroot -p < hellodb_innodb.sql
方法2:mysql中执行source hellodb_innodb.sql
2、在学生表中,查询年龄大于25岁,且为男性的同学的名字和年龄
select Name,Age from students where Age > 25 and Gender='M';
3、在学生表中,以ClassID为分组依据,查询显示每组的平均年龄
select ClassID,avg(Age) from students group by ClassID;
4、显示第2题中平均年龄大于30的分组及平均年龄
select ClassID,avg(Age) from (select ClassID,Age from students where Age > 25 and Gender='M') as filter group by ClassID having avg(Age) > 30;
5、显示以L开头的名字的同学的信息
select * from students where Name like 'L%';
6、显示老师ID非空的同学的相关信息
select * from students where TeacherID is not null;
7、students表中,查询以年龄排序后的数据,并且显示年龄最大的前10位同学的信息
select * from students order by Age desc limit 10;
8、students表中,查询年龄大于等于20岁,小于等于25岁的同学的信息
select * from students where Age between 20 and 25;
9、以ClassID分组,显示每班的同学的人数
select ClassID,count(*) from students group by ClassID;
10、以ClassID分组,显示其平均年龄大于25的班级
select ClassID,avg(Age) from students group by ClassID having avg(Age) > 25;
第十三周作业
原创
©著作权归作者所有:来自51CTO博客作者liyusheng530的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
第十三周作业
搭建时间服务器,日志服务器并简述sudo安全切和nginx模块解释
搭建时间服务器日志服务器并简述sudo -
第十三周
第十三周
第十三周 -
第十三周总结
所学时间 3小时 总代码量 200行 博客数量 0 所学知识 主要准备考试,没有编程,将之前
mapreduce ssm框架 mvc -
运维小白成长记——第十三周
运维小白的第十三周作业汇总
ip地址 mysql 状态码 -
window安装 mysqldump
最近有用户在安装win7系统的过程中,出现了“windows安装程序无法将windows配置为在此计算机的硬件上运行”的提示,导致安装win7系统失败,要如何处理呢,下面为大家详细介绍一下安装win7出现“无法将windows配置为在此计算机的硬件上运行”的具体解决方法吧。方法一:1、当出现如上提示的时候,按下shift+f10 会打开命令窗口,进入到C:\windows\system32\oob
window安装 mysqldump window无法在此计算机硬件 win7系统 windows安装 重启