ComeçarComece de graça

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.

Este exercício faz parte do curso

Creating PostgreSQL Databases

Ver curso

Instruções do exercício

  • 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.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

-- 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 ___, ___, ___;
Editar e executar o código