Get startedGet started for free

Rescinding group membership

The technology team at the SBA would like to be more proactive in assigning database access by group. Each user account must belong to at least one group. All project managers will be members of a project_management group. Therefore, Kim Lopez, should be added to this account and removed from the dev_team group. This exercise will allow you to manage group membership for these teams.

This exercise is part of the course

Creating PostgreSQL Databases

View Course

Exercise instructions

  • Create a new group named project_management.
  • Grant the project_management group the SELECT privilege on the loan table.
  • Add user klopez to the project_management group.
  • Remove user klopez from the dev_team group.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

-- Create the project_management group
___ ___ ___;

-- Grant project_management SELECT privilege
GRANT ___ ON ___ TO ___;

-- Add Kim's user to project_management group
___ ___ ___ ADD USER ___;

-- Remove Kim's user from dev_team group
REVOKE ___ FROM ___;
Edit and Run Code