D. Data Control Language (DCL)
By using DCL we can permit a user to access, modify or work on the different privileges in order to control the database.
1. GRANT
Suppose you hire a freelancer to update your airbnb_listings database with new information. By using the GRANT command you can give the user access to database objects such as tables, views or the database itself. The below example gives the user named ‘usr_maria’ SELECT and UPDATE access on the airbnb_listings table.
TEXT/X-SQL
1GRANT SELECT, UPDATE ON airbnb_listings TO usr_maria;
2. REVOKE
After the freelancer has completed her work you now want to remove the users permission. You can do so by using the REVOKE command.
TEXT/X-SQL
1REVOKE SELECT, UPDATE ON airbnb_listings FROM usr_maria;