0
0
PostgreSQLquery~5 mins

Table-level permissions in PostgreSQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are table-level permissions in PostgreSQL?
Table-level permissions control what actions users can perform on entire tables, such as SELECT, INSERT, UPDATE, and DELETE.
Click to reveal answer
beginner
Which SQL command is used to grant table-level permissions in PostgreSQL?
The GRANT command is used to give users specific permissions on tables.
Click to reveal answer
beginner
How do you revoke table-level permissions from a user in PostgreSQL?
Use the REVOKE command followed by the permission type and the user name to remove permissions on a table.
Click to reveal answer
beginner
What does the following command do? <br>
GRANT SELECT ON employees TO alice;
It allows the user 'alice' to read data from the 'employees' table but not modify it.
Click to reveal answer
intermediate
Can table-level permissions be granted to roles in PostgreSQL?
Yes, permissions can be granted to roles, which are groups of users, to simplify permission management.
Click to reveal answer
Which command grants a user permission to insert data into a table?
AGRANT INSERT ON table_name TO user_name;
BREVOKE INSERT ON table_name FROM user_name;
CGRANT SELECT ON table_name TO user_name;
DDROP TABLE table_name;
What does the REVOKE command do in PostgreSQL?
ARemoves permissions from a user
BGives permissions to a user
CCreates a new table
DDeletes data from a table
If you want a user to only read data from a table, which permission should you grant?
ADELETE
BUPDATE
CINSERT
DSELECT
Can you grant multiple permissions in one GRANT command?
ANo, only one permission at a time
BYes, by listing them separated by commas
COnly if the user is a superuser
DOnly for SELECT and INSERT
What happens if a user has no permissions on a table?
AThey can read but not write
BThey can write but not read
CThey cannot access the table at all
DThey become the table owner
Explain how to grant and revoke table-level permissions in PostgreSQL.
Think about the commands that control access to tables.
You got /5 concepts.
    Describe why table-level permissions are important in database security.
    Consider what could happen if everyone had full access to all tables.
    You got /5 concepts.