Database Reference
In-Depth Information
Examples
Use the following tables for the examples:
DEPARTMENT (DeptNo, DeptName, DeptLocation)
EMPLOYEE (EmployeeNo, FirstName, LastName, Address, Phone, Employ-
eePosition, Salary, EmployeeCode, DeptNo)
Foreign Key: DeptNo REFERENCES DEPARTMENT
1. Give permission to Rogers to read all of EMPLOYEE table.
GRANT SELECT
ON EMPLOYEE
TO Rogers
2. Give Miller and Rodriguez full privileges to the DEPARTMENT table.
GRANT ALL PRIVILEGES
ON DEPARTMENT
TO Miller, Rodriguez WITH GRANT OPTION
3. Give Chen read and update privileges on specific columns in EMPLOYEE
table.
GRANT SELECT, UPDATE (FirstName, LastName, Address, PhoneNo)
ON EMPLOYEE
TO Chen
Removing Access Privileges
SQL Command
REVOKE
Function
Remove access privileges previously granted to database objects from users.
Examples
Use the same DEPARTMENT and EMPLOYEE tables for the following examples:
1. Remove from all users the privilege to delete DEPARTMENT table rows.
REVOKE DELETE
ON DEPARTMENT
FROM PUBLIC
2. Remove from Miller all privileges on DEPARTMENT table.
REVOKE ALL PRIVILEGES
ON DEPARTMENT
FROM Miller
3. Remove from Chen update privileges on EMPLOYEE table.
REVOKE UPDATE
ON EMPLOYEE
FROM Chen
Search WWH ::




Custom Search