展开全部

1、查询每个学生的各科成绩sql语句:

select a.studentid,a.name,a.sex,v1.score as '语文',v2.score as '数学', v3.score as '英语62616964757a686964616fe59b9ee7ad9431333365646238',v4.score

as ‘哲学’, (v1.score+v2.score+v3.score+v4.score)/4 as ‘平均成绩’ from Stuednt a

left join

(select studentid,score from grade where cid=(select cid from course where cname='语文'))as v1

on a.studentid=v1.studentid

left join

(select studentid,score from grade where cid=(select cid from course where cname='数学'))as v2

on a.studentid=v2.studentid

left join

(select studentid,score from grade where cid=(select cid from course where cname='英语'))as v3

on a.studentid=v3.studentid

left join

(select studentid,score from grade where cid=(select cid from course where cname='哲学'))as v4

on a.studentid=v4.studentid

order by a.studentid

2、sql数据库介绍:

(1)SQL是Structured Query Language(结构化查询语言)的缩写。SQL是专为数据库而建立的操作命令集,是一种功能齐全的数据库语言。在使用它时,只需要发出"做什么"的命令,"怎么做"是不用使用者考虑的。

(2)SQL功能强大、简单易学、使用方便,已经成为了数据库操作的基础,并且现在几乎所有的数据库均支持SQL。

(3)SQL数据库的数据体系结构基本上是三级结构,但使用术语与传统关系模型术语不同。

(4)在SQL中,关系模式(模式)称为"基本表"(base table);存储模式(内模式)称为"存储文件"(stored file);子模式(外模式)称为"视图"(view);元组称为"行"(row);属性称为"列"(column)。

更多推荐

mysql查询学生成绩语句_查询每个学生的各科成绩sql语句