Check out example codes for "CockroachDB create user". It will help you in understanding the concepts better.

Code Example 1

#Create User
CREATE USER <CREATEDUSER> WITH PASSWORD '<PASSWORD>';

#Grants Permission for database or table
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE <DATABASENAME> TO <CREATEDUSER>;

#Revoke access from database or table
REVOKE SELECT ON DATABASE <DATABASENAME> FROM <USER_OR_ROLE>;

Learn ReactJs, React Native from akashmittal.com