6、
(1)
GRANT ALL PRIVILEGES
ON TABLE Student,Class
TO U1
WITH GRANT OPTION;
(2)
GRANT SELECT,UPDATE(Add)
ON Student
TO U2;
(3)
GRANT SELECT
ON Class
TO PUBLIC;
(4)
GRANT SELECT,UPDATE
ON Student
TO R1;
(5)
GRANT R1
TO U1
WITH ADMIN OPTION;
7、
(1)
GRANT SELECT
ON TABLE Staff,Department
TO 王明
(2)
GRANT INSERT,DELETE
ON TABLE Staff,Department
TO 李勇
(3)
GRANT SELECT
ON Staff
TO All;
不知道该添点啥好。。诶嘿,我在度娘那找到了
GRANT SELECT
ON Staff
WHEN USER()=NAME
TO ALL
(4)
GRANT SELECCT,UPDATE(Pay)
ON Staff
TO 刘星
(5)
GRANT ALTER
ON TABLE Staff,Department
TO 张新
(6)
GRANT ALL PRIVILEGES
ON TABLE Staff,Department
TO 周平
WITH GRANT OPTION
(7)我GRANT不出来
但是没有我查不到的!hhhh!创建视图然后授予权限就Okk!
创建视图:
CREATE VIEW Spay(Sname,Smax,Smin,Savg)
AS SELECT Staff.Dno,MAX(Pay),MIN(Pay),AVG(Pay)
FROM Staff,Dept
WHERE Staff.Dno=Dept.Dno
GROUP BY Staff.Dno
授予权限:
GRANT SELECT
ON VIEW Spay
TO 杨兰
8、
(1)
REVOKE SELECT
ON TABLE Staff,Department
FROM 王明
(2)
REVOKE INSERT,SELECT
ON TABLE Staff,Department
FROM 李勇
(3)
REVOKE SELECT
ON Staff
WHEN USER()=NAME
TO ALL
(4)
REVOKE SELECT,UPDATE(Pay)
ON Staff
FROM 刘星
(5)
REVOKE ALTER
ON TABLE Staff,Department
FROM 张新
(6)
REVOKE ALL PRIVILEGES
ON TABLE Staff,Department
FROM 周平 CASCADE
(7)这个自己还是不太星。。
REVOKE SELECT
ON Spay
FROM 杨兰
DROP VIEW Spay