Get startedGet started for free

Working with users and groups

Sandra's project at the SBA is turning into a great success. Loan processing is now much faster than before the rollout of the online loan platform. This results in the growth of the team responsible for the loan management platform. Sandra is now leading the team and recently hired 3 new developers. Before the new developers begin their first days on the job, Sandra would like to create database accounts for each user and give each account the same access privileges.

This exercise is part of the course

Creating PostgreSQL Databases

View Course

Exercise instructions

  • Create new user accounts for Ronald Jones (rjones), Kim Lopez (klopez), and Jessica Chen (jchen).
  • Create a new group named dev_team.
  • Grant the dev_team INSERT, UPDATE, DELETE, and SELECT privileges on the loan table.
  • Add the 3 new user accounts to the dev_team group.

Hands-on interactive exercise

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

-- Create a user account for Ronald Jones
CREATE ___ rjones WITH ___ 'changeme';

-- Create a user account for Kim Lopez
___ ___ klopez ___ ___ 'changeme';

-- Create a user account for Jessica Chen
___ ___ ___ ___ ___ ___;

-- Create the dev_team group
___ ___ ___;

-- Grant privileges to dev_team group on loan table
GRANT ___, ___, ___, ___ ON ___ TO ___;

-- Add the new user accounts to the dev_team group
ALTER GROUP ___ ADD USER ___, ___, ___;
Edit and Run Code