欢迎来到天天文库
浏览记录
ID:39580166
大小:24.00 KB
页数:3页
时间:2019-07-06
《数据库原理权限代码练习》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、createloginLiuwithpassword='123'createdatabaseteachgouseteachcreatetableliu(nameschar(4),sexchar(2),heightint,)insertintoliuvalues('liu1','M',170)insertintoliuvalues('liu2','F',165)select*fromliu--liu1createloginLiu1withpassword='123'createuserL1forloginLiu1gr
2、antselectonliutoL1revokeselectonliufromL1--liu2createloginLiu2withpassword='123'createuserL2forloginLiu2grantselectonliutoL1withgrantoption--liu3createloginLiu3withpassword='123'createuserL3forloginLiu3grantselectonliutoL3--级联收回权限revokeselectonliufromL1cascade
3、--创建角色createroler1createroler2grantinsert,update,deleteonliutor1grantdeleteonliutor2revokedeleteonliufromr2sp_droprlemember'r1','L1'gosp_droprlemember'r2','L2'gosp_droprlemember'r2','L2'grantselect(names)onliutor2revokeselect(names)onliufromr2--创建视图createviewV
4、1asselect*fromliuwherenames='liu1'gograntselectonV1toL3
此文档下载收益归作者所有