SQL实践2

SQL实践2

问题

在这里插入图片描述

答案

-- 第一题
select studentno, avg(english)
from mark;

-- 第二题
select studentno,math,address,telno
from cust 
join mark on cust.studentno = mark.studentno
where studentno in(11,22,33,44,55);

-- 第三题
select name, computer
from cust 
join mark on cust.studentno = mark.studentno
order by computer;

-- 第四题
select studentno, name, sum(english+math+computer) scoreAll
from cust 
join mark on cust.studentno = mark.studentno
group by studentno
having scoreAll > 240
order by scoreAll desc;

猜你喜欢

转载自blog.csdn.net/Chan1way/article/details/108469367