赞
踩
表一:cust
表二;mark
SQL语句:
SELECT
AVG(english) 英语平均成绩
FROM
mark
结果如图:
SQL语句:
SELECT
cust.name,mark.math,cust.address,cust.telno
FROM
mark
JOIN cust ON mark.studentno = cust.studentno
WHERE
cust.studentno = 2
OR cust.studentno = 3
OR cust.studentno = 4
OR cust.studentno = 5
OR cust.studentno = 6
结果如图:
SQL语句:
SELECT
cust.name,mark.computer
FROM
mark
JOIN cust ON mark.studentno = cust.studentno
ORDER BY
mark.computer
DESC
结果如图:
SQL语句:
SELECT
cust.studentno,cust.name,SUM(english+math+computer) 总成绩
FROM
mark
JOIN cust ON mark.studentno = cust.studentno
GROUP BY
cust.studentno
HAVING
总成绩 >240
ORDER BY
总成绩
DESC
结果如图:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。