一、统计学生表,统计共多少个学生。
Select count(*) as ta
from Studentlj
二、统计学生表,统计年龄大于20岁的学生有多少个。
Select count(*) as ta
from Studentlj
where sage >20
三、统计学生表,统计出生年份在1999年至2002年的学生人数。
select count(*) as ta
from studentlj
where 2020-sage between 1999 and 2002
四、统计学生选修表,统计学号为2012151222的学生平均成绩。
select avg(grade) as av
from sclj
where sno='201215222'
五、统计学生选修表,统计学号为20121511221的学生总成绩。
select sum(grade) as total
from sclj
where sno='2012151121'
六、统计学生选修表,统计课程号为“1”课程的最高成绩。
select max(grade) as m
from sclj
where cno='1'
七、统计学生表,查询所有学生中最高的出生年份。
select 2020-max(sage)
from studentlj
select min(2020-sage)
from studentlj