SQL语句不正确

时间:2014-03-23 16:20:08

标签: sql security

如果我希望Account Albert检索或修改除DEPENDENT和以外的任何关系 可以将这些权限授予其他用户,我将如何做到这一点?

我尝试了GRANT功能:

GRANT SELECT EMPLOYEE to Albert 
GRANT SELECT DEPARTMENT to Albert 
GRANT SELECT DEPT_LOCATIONS to Albert 
GRANT SELECT PROJECT to Albert 
GRANT SELECT WORKS_ON to Albert 

但我如何让albert修改?

架构:

EMPLOYEE (Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, 
Super_ssn, Dno)
DEPARTMENT (Dname, Dnumber, Mgr_ssn, Mgr_start_date)
DEPT_LOCATIONS(Dnumber, Dlocation)
PROJECT(Pname, Pnumber, Plocation, Dnum)
WORKS_ON(Essn, Pno, Hours)
DEPENDENT(Essn, Dependent_name, Sex, Bdate, Relationship)

2 个答案:

答案 0 :(得分:0)

到目前为止,您只授予SELECT权限。您也想要授予UPDATE。也许INSERT和DELETE?

GRANT SELECT, UPDATE, INSERT, DELETE on EMPLOYEE to Albert ;
...

答案 1 :(得分:0)

Try it :

GRANT SELECT on EMPLOYEE to Albert 
GRANT SELECT on DEPARTMENT to Albert 
GRANT SELECT on DEPT_LOCATIONS to Albert 
GRANT SELECT on PROJECT to Albert 
GRANT SELECT on WORKS_ON to Albert