导航菜单
首页 >  » 正文

有一个[学生课程]数据库,数据库中包括三个表: SQL关系代数,求至少选修了两门以上课的学生的学号,用关系代数写出来。

有一个[学生课程]数据库,数据库中包括三个表:

1
create table student(
sno varchar(5) not null primary key,
sname varchar(10),
ssex char(2),
sage int,
sdept varchar(20))
2
alter table student add scome datetime
3
select sno,grade from sg where cno=5 order by grade desc
4
select max(grade) as 最高成绩,avg(grade) as 平均成绩 from sg where cno=1
5
delete from student where sno=05019

SQL关系代数,求至少选修了两门以上课的学生的学号,用关系代数写出来。

study(sno,cno,score)查询至少选修了两门课程的学生学号:π1(σ(1=4Λ2!=5)(study x study))

统计每个学生的选课门数和考试总成绩,并按选课门数的降序排列

select
课程,
count(课程编号)
as
选课人数
,
avg(成绩)
as
平均成绩
from

group
by
课程编号

相关推荐: