Free PGCES-02 Exam Braindumps (page: 18)

Page 17 of 36

The following SQL defines an INSERT with respect to item_view.
Select the keyword that is applicable in the underlined blank.
CREATE _______ foo AS ON INSERT TO item_view
DO INSTEAD INSERT INTO item_table VALUES (NEW.id, NEW.itemname);

  1. RULE
  2. VIEW
  3. TRIGGER
  4. FUNCTION
  5. CONSTRAINT

Answer(s): A



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






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

PGCES-02 Exam Discussions & Posts