竞选及SQL

来源:互联网 发布:电商app行业数据 编辑:程序博客网 时间:2024/04/28 17:09

这年头

没想到发传单

也要抢职位

哎呀

 

select a.stu_name as '学生姓名',--查询用select
b.course_id as '课程编号',
c.score_score as '分数',
a.stu_id AS '学生编号',
b.course_name as '课程名称'
from --从那个表
tb_student as a,
tb_course as b,
tb_score as c
where a.stu_id=c.score_stuid and b.course_id=c.score_courseid--where接条件
order by b.course_name
compute avg(score_score),
sum(score_score)
by b.course_name--order by要与compute by连用
 

 

原创粉丝点击