0
0
PostgreSQLquery~10 mins

Table-level permissions in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to grant SELECT permission on the table 'employees' to user 'john'.

PostgreSQL
GRANT [1] ON employees TO john;
Drag options to blanks, or click blank then click option'
ADELETE
BINSERT
CUPDATE
DSELECT
Attempts:
3 left
💡 Hint
Common Mistakes
Using INSERT instead of SELECT
Using UPDATE or DELETE which are for modifying data
2fill in blank
medium

Complete the code to revoke INSERT permission on the table 'products' from user 'alice'.

PostgreSQL
REVOKE [1] ON products FROM alice;
Drag options to blanks, or click blank then click option'
AINSERT
BSELECT
CUPDATE
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking SELECT instead of INSERT
Confusing UPDATE with INSERT
3fill in blank
hard

Fix the error in the code to grant UPDATE permission on 'orders' to user 'mike'.

PostgreSQL
GRANT [1] ON orders TO mike;
Drag options to blanks, or click blank then click option'
AUPDATE;
BUPDATE
CUPDATE ON
DUPDATE TO
Attempts:
3 left
💡 Hint
Common Mistakes
Missing semicolon at the end
Adding extra keywords like ON or TO incorrectly
4fill in blank
hard

Fill both blanks to grant DELETE and SELECT permissions on 'customers' to user 'emma'.

PostgreSQL
GRANT [1], [2] ON customers TO emma;
Drag options to blanks, or click blank then click option'
ADELETE
BSELECT
CINSERT
DUPDATE
Attempts:
3 left
💡 Hint
Common Mistakes
Using INSERT or UPDATE instead of DELETE or SELECT
Forgetting the comma between permissions
5fill in blank
hard

Fill all three blanks to revoke SELECT and UPDATE permissions on 'inventory' from user 'dave'.

PostgreSQL
REVOKE [1], [2] ON inventory FROM [3];
Drag options to blanks, or click blank then click option'
ASELECT
BUPDATE
Cdave
Dalice
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking wrong permissions
Using wrong username in the statement