数据库基础与应用的作业(做完后在加分)
?于大宝?
2024-05-30 04:43:41
最佳回答
create table student(sno char(10) not **,sname char(10),sex char(10),sdept char(10),sage char(10),primary key(sno));create table course(cno char(10) not **,cname char(10),credit integer,primary key(cno));create table sc(cno char(10) not **,sno char(10) not **,grade integer,primary key(cno,sno),foreign key(cno)references course(cno),foreign key(sno)references student(sno));select sno,sname,sexfrom studentselect student.sno,sname,count(course.cno)from student,course,scwhere student.sno=sc.sno and course.cno=sc.cnoselect sno,sname,**g(grade)from student,scwhere sno=95001 and student.sno=sc.snoselect cname,gradefrom sc,coursewhere sno=95001 and course.cno=sc.cnogroup by cname,gradeselect a sc.grade ,**g(grade),b sc.grade,count(sc.sno)from sc,coursewhere cname='数据结构' and course.cno=sc.cno and (select grade into a from sc where grade>=all(select grade from sc)) and (select grade into b from sc where grade<=all(select grade from sc)) 20210311