mysql查询未讲课教师_mysql练习

本文列举了一系列关于MySQL的查询实例,包括查询特定条件的成绩、同年出生的学生、教师任教的课程、选修人数多的课程、特定班级学生、高于平均成绩的记录、未讲课的教师等。通过这些例子,读者可以深入理解MySQL的查询语法和使用技巧。
摘要由CSDN通过智能技术生成

1.询成绩高于学号为“109”、课程号为“3-105”的成绩的所有记录。

select * from score where degree>(select degree from score where cno=3-105 and sno=109)

2.查询和学号为108、101的同学同年出生的所有学生的Sno、Sname和Sbirthday列。

select sno,sname,sbirthday

from student

where year(sbirthday)=(select year(sbirthday) from student where sno=108)

select sno,sname,sbirthday

from student

where year(sbirthday)=(select year(sbirthday) from student where sno=101)

3.查询“张旭“教师任课的学生成绩。

SELECT sno,degree from score

where cno=(select cno from course where tno =(select tno from teacher where tname="张旭") )

4.查询选修某课程的同学人数多于5人的教师姓名。

select tname from teacher

where tno in (select tno from course where cno in (select cno from score GROUP BY cno having count(*)>5))

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值