Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Permissions for Table Groups

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL Permissions for Table Groups. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Write SQL statements to grant permissions for each of your tables to a specific group.

Asked in the VO stage. Final VO round SQL question.

Requirements

  1. Write the SQL needed to grant a chosen role access to every existing table in a schema.
  2. Include the statement needed so future tables in that schema also inherit the same permission.
  3. Use PostgreSQL syntax only.

Schema

schema_tables
ColumnTypeDescription
schema_nameVARCHAR(128)Schema that contains the tables
table_nameVARCHAR(128)Table name
grantee_roleVARCHAR(128)Role or group that should receive access
privilege_typeVARCHAR(32)Requested privilege
Tablesschema_tables
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results