Sample Exam Questions
createuser -h pgserver -p 5432 -d -U john
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/07
A PostgreSQL database instance consists of a database cluster. This cluster, which is made up of multiple databases, is managed by a single set of server processes.
You create the database cluster with the initdb command. Immediately after creation, it contains three databases: template0, template1, and postgres.
To add a new database, you can connect to the database and issue the SQL CREATE DATABASE command. Alternatively, you can run the createdb command from the OS command line. This command connects to the database and internally issues the CREATE DATABASE command to create a new database.
Since you cannot create a new database without connecting to it, the database cluster must be running. With the -h and -p options of the createdb command, you can specify the host name and port number to connect to. This allows you to connect to a database running on another host on the network and create a new database there.
Creating a database requires the special CREATEDB privilege. Just having the right to connect to the database is not enough.
The configuration of a database instance varies greatly depending on the type of RDBMS. The SQL command CREATE DATABASE is a PostgreSQL extension, as is the createdb command. Please note that the method of creating a database depends on the type of RDBMS.
Therefore, the correct answers are B and C.
© EDUCO All Rights Reserved.