Free PGCES-02 Exam Braindumps
PGCES-02 PostgreSQL CE 8 Silver Questions 51–55 (page: 12)

Updated On: 9-Feb-2026

A sequence has the following definition:
CREATE SEQUENCE seq1 CACHE 10 CYCLE;
Select the value that is returned by executing the following SQL. SELECT nextval('seq1');

  1. 0
  2. 1
  3. 10
  4. 11
  5. -10

Answer(s): B



A table and view are defined as follows:
CREATE TABLE item (id INT, name TEXT, description TEXT);
CREATE VIEW item_simple AS SELECT id, name FROM item;
A set of SQL statements were executed in the order below. Select the most appropriate statement concerning the execution results.
BEGIN;
SELECT * FROM item_simple;
INSERT INTO item_simple VALUES (1, 'item_name_1');
UPDATE item_simple SET name = 'item_name_2' WHERE id = 1; DELETE FROM item_simple;
END;

  1. An error is generated at the point the SELECT statement is executed.
  2. An error is generated at the point the INSERT statement is executed.
  3. An error is generated at the point the UPDATE statement is executed.
  4. An error is generated at the point the DELETE statement is executed.
  5. No error is generated.

Answer(s): B



The present time is noon of July 7th, 2007, and the result of the following
SQL sentence was '2007-07-17 12:00:00'.
Select the correct expression to fill in the blank below.
SELECT CURRENT_TIMESTAMP::timestamp + ________________ ;

  1. '10 day'::timestamp
  2. '10 day'::interval
  3. 10::day
  4. 8640000::time
  5. age(8640000)

Answer(s): B



You want to set a constraint so that the "item_id" in the "sales" table will always have a value that
already exists as "id" in the "item_master" table. Select the correct SQL statement to fill in the
underlined blank of the "sales" table. Definitions:
CREATE TABLE item_master (
id INTEGER PRIMARY KEY,
name TEXT
);
CREATE TABLE sales (
sales_id INTEGER,
item_id INTEGER,
num INTEGER,
);

  1. FOREIGN KEY (id) REFERENCES item_master (item_id)
  2. FOREIGN KEY (item_id) REFERENCES item_master (id)
  3. REFERENCES item_master (item_id)
  4. REFERENCES item_master (id)
  5. REFERENCES item_master (id) TO item_id

Answer(s): B



You want to delete rows in the "product" table which include the value '2004' in the "name" field. Select the correct statement to achieve this task.

  1. DELETE product WHERE name ~ '2004';
  2. DELETE product WHERE contain(name, '2004');
  3. DELETE FROM product WHERE name IN '2004';
  4. DELETE FROM product WHERE name LIKE '%2004%';
  5. DELETE FROM product WHERE name SIMILAR TO '2004';

Answer(s): D



Viewing page 12 of 30
Viewing questions 56 - 60 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!