Postgresql PGCES-02 Exam
PGCES-02 PostgreSQL CE 8 Silver (Page 7 )

Updated On: 7-Feb-2026

A table named "sample" is defined as below. Select two statements which will generate a
constraint error.
CREATE TABLE sample (
i INTEGER PRIMARY KEY,
j INTEGER,
CHECK ( i > 0 AND j < 0 )
);

  1. INSERT INTO sample VALUES (1, 0);
  2. INSERT INTO sample VALUES (2, -2);
  3. INSERT INTO sample VALUES (3, NULL);
  4. INSERT INTO sample VALUES (NULL, -4);
  5. INSERT INTO sample VALUES (5, -5);

Answer(s): A,D



The following is the result of executing the createlang command which is installed with PostgreSQL.
$ createlang -U postgres --list mydb
Procedural Languages
Name | Trusted?
---------+----------
plpgsql | yes
Select two correct statements from below.

  1. The procedural language plpgsql is installed in the database mydb using the above command.
  2. The procedural language plpgsql can be used in the database mydb.
  3. plpgsql is a trusted language, so it can execute the OS commands on the server side.
  4. plpgsql is a trusted language, so it can read/write OS files on the server side.
  5. plpgsql is a safe language with restricted operations.

Answer(s): B,E



Given the following two table definitions, select one SQL statement which will cause an error. CREATE TABLE sample1 (id INTEGER, data TEXT);
CREATE TABLE sample2 (id INTEGER);

  1. SELECT id AS data, data FROM sample1;
  2. SELECT id, id FROM sample1;
  3. SELECT s1.id, s2.id FROM sample1 AS s1, sample1 AS s2;
  4. SELECT s1.id, s2.id FROM sample1 s1, sample2 s2;
  5. SELECT s1.id, s2.data FROM sample1 s1, sample2 s2;

Answer(s): E



Select two suitable statements regarding creating a new table.

  1. There is no upper limit to the number of columns in a table.
  2. A newly created table is empty and has 0 rows.
  3. You can only use alphabetic characters for a table name.
  4. The row name must be within 16 characters.
  5. The SQL 'CREATE TABLE' statement is used to create a new table.

Answer(s): B,E



The tables "t1" and "t2" are defined below.
The tables "t1" and "t2" have columns "id" which are type of INTEGER and column "name"s which are type of TEXT.
t1
t2
The following SQL command was executed. Select the number of rows in the result. SELECT * FROM t1 NATURAL FULL OUTER JOIN t2;

  1. 2 rows
  2. 3 rows
  3. 4 rows
  4. 5 rows
  5. 6 rows

Answer(s): D






Post your Comments and Discuss Postgresql PGCES-02 exam prep with other Community members:

Join the PGCES-02 Discussion