select sname from student
where sdept=‘数学’and sname like ‘王%’ order by sage;
2. 查询每个班级每门课程的选课人数和平均分; select clno,cno,count(*) 选课人数,avg(grade) 平均分 from student,sc where =
group by clno,cno;
3.查询李爽同学没选修的课程名; SELECT cname FROM course WHERE NOT EXISTS (SELECT * FROM sc WHERE cno= AND sno=
(SELECT sno FROM student WHERE sname='李爽'));
此题可有多种答案
4. 把对表Course的查询权限及对Ccredit字段的更新权限授予用户张三;
GRANT SELECT ,UPDATE(Ccredit) ON course TO 张三;
5. 将01311班全体学生成绩置空; UPDATE sc
SET grade=NULL WHERE sno IN
(SELECT sno FROM student WHERE clno='01311');
杭电数据库概论月A卷
selectsnamefromstudentwheresdept=‘数学’andsnamelike‘王%’orderbysage;2.查询每个班级每门课程的选课人数和平均分;selectclno,cno,count(*)选课人数,avg(grade)平均分fromstudent,scwhere=group
推荐度:
点击下载文档文档为doc格式