Free PGCES-02 Exam Braindumps
PGCES-02 PostgreSQL CE 8 Silver Questions 66–70 (page: 15)

Updated On: 9-Feb-2026

The tables "s1" and "s2" are defined below.
The column "id" for tables "s1" and "s2" is of INTEGER type. The column "enable" for table "s1" is
of
BOOLEAN type, and the column "name" for table "s2" is of TEXT type. s1:
id | enable
----+--------
1 | t
2 | f

s2:
id | name
----+------
1 | post
2 | gre
3 | SQL

The following SQL was executed. Select the correct number of rows in the result. SELECT * FROM s2 WHERE id IN (SELECT id FROM s1);

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

Answer(s): B



A table is defined as below. Select the most suitable description about the foreign key constraint.
CREATE TABLE master (id INTEGER PRIMARY KEY, name TEXT);
CREATE TABLE record (id INTEGER REFERENCES master (id), count INTEGER);

  1. If any row exists in the "record" table, no change can be made to the "master" table.
  2. If the "record" table contains a row with an "id", no change can be made at all to the
    corresponding "id" row in the "master" table.
  3. If the "record" table contains a row with an "id", the corresponding "id" row in the "master"
    table cannot be deleted.
  4. The "record" table cannot have duplicate "id"s.
  5. These SQL statements are invalid; no constraints are created.

Answer(s): C



You want to create a cursor that will SELECT the "customer" table. The created cursor must be able to move in any direction and reference data even after the end of the transaction.
Select one answer containing the correct keyword(s) to fill in the underlined blank below.
DECLARE cursor1 __________ FOR SELECT * FROM customer;

  1. CURSOR
  2. SCROLL CURSOR WITH HOLD
  3. INSENSITIVE CURSOR
  4. NO SCROLL CURSOR WITH HOLD
  5. CURSOR WITHOUT HOLD

Answer(s): B



Select the correct result generated by execution of the following SQL statements: CREATE TABLE log (id int, message TEXT, logtime TIMESTAMP);
CREATE TABLE log_01 () INHERITS (log);
INSERT INTO log_01 VALUES (1, 'error', CURRENT_TIMESTAMP); SELECT * FROM log;

  1. First 'CREATE TABLE' generates a syntax error.
  2. Second 'CREATE TABLE' generates a syntax error.
  3. 'INSERT' statement generates an error stating that the number of columns and values do not match".
  4. 'SELECT' statement returns 0 rows, and exits successfully.
  5. 'SELECT' statement returns 1 row, and exits successfully.

Answer(s): E



The "sample" table consists of the data below. The column "x" is of type INTEGER. How many rows are returned by executing the following SQL statement?
SELECT 6 / x FROM sample
WHERE CASE WHEN x = 0 THEN FALSE ELSE TRUE END;

  1. "ERROR division by zero" and no rows are returned.
  2. 0 rows with no errors.
  3. 1 row
  4. 2 rows
  5. 3 rows

Answer(s): D



Viewing page 15 of 30
Viewing questions 71 - 75 out of 142 questions


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

AI Tutor AI Tutor 👋 I’m here to help!