Complete the code to select all columns from the users table.
SELECT [1] FROM users;The asterisk (*) selects all columns from the table.
Complete the code to restrict access to only users with role 'admin'.
SELECT * FROM users WHERE role = [1];Only users with the role 'admin' should be selected for secure access.
Fix the error in the code to grant SELECT permission on the employees table to user 'john'.
GRANT SELECT ON [1] TO john;In PostgreSQL, you grant permissions on the table name directly, not with extra keywords.
Fill both blanks to create a user 'alice' with password 'secure123' and grant her SELECT permission on the sales table.
CREATE USER [1] WITH PASSWORD [2]; GRANT SELECT ON sales TO alice;
Usernames are not quoted in CREATE USER, but passwords must be quoted strings.
Fill all three blanks to revoke INSERT and UPDATE permissions from user 'bob' on the customers table.
REVOKE [1], [2] ON customers FROM [3];
We revoke INSERT and UPDATE privileges from user 'bob' to restrict data changes.