考试用标准SQL的话!我就用标准SQL写啦!
6、(1)
GRANT ALL PRIVILEGES
ON Student,Class
TO U1
WITH GRANT OPTION;
(2)
GRANT SELECT,UPDATE(家庭住址)
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 GRANT OPTION;
7、8题写在一起拉!!!!!
(1)
GRANT SELECT
ON 职工,部门
TO 王明;
REVOKE SELECT
ON 职工,部门
FROM 王明;
(2)
GRANT INSERT,DELETE
ON 职工,部门
TO 李勇;
REVOKE INSERT,DELETE
ON 职工,部门
FROM 李勇;
(3)
GRANT SELECT
ON 职工
WHEN USER()=Sname
TO ALL;
REVOKE SELECT
ON 职工
WHEN USER()=Sname
FROM ALL;
(4)
GRANT SELECT,UPDATE(工资)
ON 职工
TO 刘星;
REVOKE SELECT,UPDATE(工资)
ON 职工
FROM 刘星;
(5)
GRANT ALTER
ON 职工,部门
TO 张新;
REVOKE ALTER
ON 职工,部门
FROM 张新;
(6)
GRANT ALL PRIVILEGES
ON 职工,部门
TO 周平;
REVOKE ALL PRIVILEGES
ON 职工,部门
FROM 周平;
(7)
GRANT VIEW A
AS
SELECT 部门.部门号,MAX(工资),MIN(工资),AVG(工资)
FROM 职工,部门
WHERE 职工.部门号=部门.部门号
GROUP BY 职工.部门号;
GRANT SELECT
ON VIEW A
TO 杨兰;
REVOKE SELECT
ON VIEW A
FROM 杨兰;
只用标准SQL写舒服多啦啊哈哈哈哈哈💃