SQL GRANT Permissions Guide

To grant users permission to modify a table, the GRANT command in SQL can be used.

The grammar is as follows:
Here is the grammar:

GRANT {permission_type(s)} ON table_name TO user_name;

permission_type(s) refers to the type of permission being granted, which can be one of the following:

  1. SELECT: Allows users to query tables.
  2. INSERT: Allows users to add new records to the table.
  3. UPDATE: Users are allowed to modify existing records in the table.
  4. DELETE: Allows users to remove records from the table.

table_name is the name of the table where permissions need to be granted.

“user_name is the name of the user that needs to be granted permission.”

To grant user “john” permission to modify the table “employees,” you can use the following command:

GRANT UPDATE, INSERT, DELETE ON employees TO john;

This will allow the user “John” to perform update, insert, and delete operations on the “employees” table.

bannerAds