Free PGCES-02 Exam Braindumps (page: 15)

Page 14 of 36

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



There is a table "tb1" that has a column "c1" defined as type TEXT. The following SQL is executed while client "A" is connected.
BEGIN;
LOCK TABLE tb1 IN ACCESS EXCLUSIVE MODE; SELECT * FROM tb1;
While the above 'SELECT' statement is being executed, client "B" connects to the same database and executes the following SQL.
Select two correct statements describing the behavior of PostgreSQL.
INSERT INTO tb1 (c1) VALUES ('new line');
Note: the default transaction isolation level is set to "read committed".

  1. The process for client "B" is blocked until the current connection for client "A" is finished.
  2. The process for client "B" is blocked until the current transaction for client "A" is finished.
  3. The process for client "B" will be deleted regardless of the condition of client "A".
  4. The process of client "B" will affect the SELECT result of client "A".
  5. The process of client "B" will not affect the SELECT result of client "A".

Answer(s): B,E






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

PGCES-02 Exam Discussions & Posts