0
0
PostgreSQLquery~10 mins

Column-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 column 'email' of the 'users' table to user 'alice'.

PostgreSQL
GRANT SELECT ([1]) ON users TO alice;
Drag options to blanks, or click blank then click option'
Aid
Bpassword
Cemail
Dusername
Attempts:
3 left
💡 Hint
Common Mistakes
Granting permission on the whole table instead of a specific column.
Using the wrong column name.
2fill in blank
medium

Complete the code to revoke SELECT permission on the 'salary' column from user 'bob'.

PostgreSQL
REVOKE SELECT ([1]) ON employees FROM bob;
Drag options to blanks, or click blank then click option'
Asalary
Bposition
Cdepartment
Dhire_date
Attempts:
3 left
💡 Hint
Common Mistakes
Revoking permission on the wrong column.
Forgetting to specify the column in parentheses.
3fill in blank
hard

Fix the error in the code to grant SELECT permission on the 'phone' column to user 'carol'.

PostgreSQL
GRANT SELECT [1] ON contacts TO carol;
Drag options to blanks, or click blank then click option'
A( )
B(phone)
CON
Dphone
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting parentheses around the column name.
Adding extra keywords inside the parentheses.
4fill in blank
hard

Fill both blanks to grant SELECT permission on columns 'name' and 'email' to user 'dave'.

PostgreSQL
GRANT SELECT ([1], [2]) ON customers TO dave;
Drag options to blanks, or click blank then click option'
Aname
Bphone
Cemail
Daddress
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong column names.
Forgetting the comma between columns.
5fill in blank
hard

Fill all three blanks to revoke SELECT permission on columns 'price', 'quantity', and 'discount' from user 'eve'.

PostgreSQL
REVOKE SELECT ([1], [2], [3]) ON sales FROM eve;
Drag options to blanks, or click blank then click option'
Aprice
Bquantity
Cdiscount
Dtotal
Attempts:
3 left
💡 Hint
Common Mistakes
Including columns not intended for revocation.
Missing commas between column names.