-选择列表中的列 'Student.sname' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
SELECT Student.sno,sname,AVG(grade) AS avg_g
FROM Student,SC www.jb51.net
WHERE Student.sno=SC.sno AND cno>'008'
GROUP BY Student.sno --没加 Student. 列名 'sno' 不明确。
HAVING MIN(grade) >= 60
ORDER BY avg_g DESC;
/*
把对Student表和Course表的全部权限授予用户U2和U3
GRANT ALL PRIVILIGES www.jb51.net
ON TABLE Student, Course
TO U2, U3;
把对表SC的查询权限授予所有用户
GRANT SELECT ON TABLE SC
TO PUBLIC;
把查询Student表和修改学生学号的权限授给用户U4
GRANT UPDATE(Sno), SELECT
ON TABLE Student TO U4;
把用户U4修改学生学号的权限收回
REVOKE UPDATE(Sno) ON TABLE Student FROM U4;
*/