Sample Exam Questions

From the objective of OSS-DB Exam Silver
- Operation and Management - Basic operation management task (method of adding, deleting, changing database user)

Sample Question

1.13

Choose two appropriate methods to add a user ‘foo’ with authority to create a database. In the following options, $ is the command prompt of the OS, => is the command prompt of psql, and the user executing the command is given the necessary authority.

  1. $ createuser -c foo
  2. $ createuser -d foo
  3. $ createuser -D foo
  4. => create user foo with db;
  5. => create user foo createdb;

※This sample exam is different from those that appear in the actual OSS-DB Exam.
2019/03/04

Answer and Explanation

To create a new user (role), execute the createuser command from the OS command prompt, or connect to the database with psql etc. and execute SQL CREATE USER or CREATE ROLE. 

 

The createuser command is executed by the following form. 

  createuser [options] [user name] 

Options that is described in this question have the following meanings. 

  -c: Maximum number of connections for new users, default is infinity 

  -d: Give the new user authority to create the database 

  -D: Do not grant database creation authority to new users (default) 

 

On the other hand, SQL CREATE USER is executed by the following form.

  CREATE USER user name [[WITH] option] 

The WITH keyword may or may not be present.  To grant database creation authority, specify CREATEDB as an option. 

Therefore the correct answers are B and E.