Challenge - 5 Problems
Permission Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
What is the effect of this GRANT command?
Consider the following SQL command executed in PostgreSQL:
What permissions does user_jane have on the employees table after this command?
GRANT SELECT, INSERT ON TABLE employees TO user_jane;What permissions does user_jane have on the employees table after this command?
Attempts:
2 left
💡 Hint
SELECT allows reading data, INSERT allows adding new rows.
✗ Incorrect
The GRANT command gives user_jane permission to SELECT (read) and INSERT (add new rows) on the employees table. It does not allow deleting or modifying the table structure.
❓ query_result
intermediate2:00remaining
What happens after this REVOKE command?
Assume user_john has SELECT and UPDATE permissions on the products table.
After running:
Which of the following is true?
After running:
REVOKE UPDATE ON products FROM user_john;Which of the following is true?
Attempts:
2 left
💡 Hint
REVOKE only removes specified permissions.
✗ Incorrect
REVOKE UPDATE removes only the update permission. user_john still has SELECT permission to read data.
📝 Syntax
advanced2:00remaining
Which GRANT command is syntactically correct to give all privileges on a table?
You want to give all possible permissions on the table orders to user_mike.
Which of the following commands is correct in PostgreSQL?
Which of the following commands is correct in PostgreSQL?
Attempts:
2 left
💡 Hint
PostgreSQL uses 'ALL' without 'PRIVILEGES' keyword.
✗ Incorrect
In PostgreSQL, the correct syntax to grant all privileges is 'GRANT ALL ON table TO user;'. The keyword 'PRIVILEGES' is not used.
🧠 Conceptual
advanced2:00remaining
What is the effect of granting permissions WITH GRANT OPTION?
In PostgreSQL, what does adding
WITH GRANT OPTION to a GRANT command do?Attempts:
2 left
💡 Hint
Think about permission delegation.
✗ Incorrect
WITH GRANT OPTION lets the user pass on the granted permissions to other users.
🔧 Debug
expert2:00remaining
Why does this REVOKE command fail with an error?
Given the command:
Why does PostgreSQL raise a syntax error?
REVOKE SELECT, INSERT FROM user_anna ON TABLE sales;Why does PostgreSQL raise a syntax error?
Attempts:
2 left
💡 Hint
Check the correct syntax order for REVOKE.
✗ Incorrect
In PostgreSQL, the correct syntax is REVOKE permissions ON table FROM user; The keyword TABLE is not used after ON.