这篇文章主要介绍了50条sql查询技巧、查询语句示例,本文以学生表、课程表、成绩表、教师表为例,讲解不同需求下的sql语句写法,需要的朋友可以参考下student(s#,sname,sage,ssex) 学生表course(c#,cname,t#) 课程表sc(s#,c#,score) 成绩表teacher(t#,tname) 教师表问题:1、查询“001”课程比“002”课程成绩高的所有学生的学号;代码如下:select a.s# from (select s#,score from sc where c#='001') a,(select s#,scorefrom sc where c#='002') bwhere a.scoreb.score and a.s#=b.s#;2、查询平均成绩大于60分的同学的学号