GRANT (PRIVILEGE) Examples
The following are GRANT (privilege) statement examples:
1. Grant select and update privileges on the salary table to the group, acct_clerk.
GRANT SELECT, UPDATE ON TABLE salary
TO GROUP acct_clerk;
2. Grant update privilege on the columns, empname and empaddress, in the employee table to the users, joank and gerryr.
GRANT UPDATE(empname, empaddress)
ON TABLE employee
TO joank, gerryr;
3. Enable any employee in accounting to change columns containing salary information.
GRANT UPDATE ON employee.salary, employee.socsec
TO GROUP accounting;
4. Enable the accounting manager, rickr, complete access to salary information and to grant permissions to other user.
GRANT ALL ON employee TO rickr WITH GRANT OPTION;
5. Enable any user to create a table constraint that references the employee roster.
GRANT REFERENCES ON emp_roster TO PUBLIC;