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

Updated On: 7-Feb-2026

The table "custom" is defined below.
The "id" column and "introducer" column are of INTEGER type, and the "email" column is of TEXT type.

id | email | introducer
----+-----------------+------------
2 | aaa@example.com | 1
3 | bbb@example.com | 2
4 | ccc@example.com | 2
Three SQL statements were executed in the following order: INSERT INTO custom
SELECT max(id) + 1, 'ddd@example.com', 4 FROM custom;
UPDATE custom SET introducer = 999
WHERE email = 'bbb@example.com';
DELETE FROM custom
WHERE introducer NOT IN (SELECT id FROM custom);
Select the number of rows in the "custom" table after the execution.

  1. 0 rows
  2. 1 row
  3. 2 rows
  4. 3 rows
  5. 4 rows

Answer(s): C



The "sample" table consists of the following data:
How many rows are returned by executing the following SQL statement? SELECT * FROM sample WHERE v ~ 'ab';

  1. 0 rows
  2. 1 row
  3. 2 rows
  4. 3 rows
  5. 4 rows

Answer(s): C



Select an incorrect statement regarding the following SQL statement. Note that "user_view" is a
view.
CREATE OR REPLACE RULE rule_1 AS ON UPDATE TO user_view DO INSTEAD NOTHING;

  1. It is defining a rule "rule_1".
  2. It will replace "rule_1" if it already exists.
  3. Executing 'UPDATE user_view' will no longer output errors.
  4. When executing 'UPDATE user_view', data is updated in the table that is the origin of the
    view.
  5. 'DROP RULE rule_1 ON user_view' deletes the above definition.

Answer(s): D



The "animal" table consists of the following data:
Select the correct result returned by executing the following SQL statement:
SELECT name FROM animal ORDER BY weight DESC LIMIT 2 OFFSET 1;

  1. A syntax error will occur.

Answer(s): A



Four SQL statements were executed in the following order. CREATE TABLE foo (bar INT);
ALTER TABLE foo ALTER bar TYPE BIGINT;
ALTER TABLE foo ADD baz VARCHAR(5);
ALTER TABLE foo DROP bar;
Select two SQL statements that generate an error when executed.

  1. INSERT INTO foo VALUES ('12345');
  2. INSERT INTO foo VALUES ('5000000000');
  3. INSERT INTO foo VALUES ('ABC');
  4. INSERT INTO foo VALUES (2000000000);
  5. INSERT INTO foo VALUES (NULL);

Answer(s): B,D



Viewing page 5 of 30
Viewing questions 21 - 25 out of 142 questions



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

Join the PGCES-02 Discussion