第四章课后作业 数据库课程

以下为标准SQL的答案

6、

grant all privileces on table 学生,班级 to U1 with grant option; -- (1)
grant select,update(家庭地址) on table 学生 to U2; -- (2)
grant select on table 班级 to public; -- (3)
grant select,update on table 学生 to R1; -- (4)
grant R1 to U1 with admin option; -- (5)

7、

grant select on table 职工,部门 to 王明; -- (1)
grant insert,delete on table 职工,部门 to 李勇; -- (2)
grant select on table 职工 when user()=name to all; -- (3)
grant select,update(工资) on table 职工 to 刘星; -- (4)
grant alter table on table 职工,部门 to 张新; -- (5)
grant all privileces on table 职工,部门 to 周平 with grant option; -- (6)

create view 各部门工资 
as
select 名称,max(工资) as 最高工资,min(工资) as 最低工资,avg(工资) as 平均工资 from 职工,部门 
where 职工.部门号=部门.部门号 
group by 职工.部门号; -- 建立视图
grant select on table 各部门工资 to 杨兰; -- (7)

8、

revoke select on table 职工,部门 from 王明; -- (1)
revoke insert,delete on table 职工,部门 from 李勇; -- (2)
revoke select on table 职工 when user()=name from all; -- (3)
revoke select,update(工资) on table 职工 from 刘星; -- (4)
revoke alter table on table 职工,部门 from 张新; -- (5)
revoke all privileces on table 职工,部门 from 周平; -- (6)
revoke select on table 各部门工资 from 杨兰; -- (7)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值