Free PGCES-02 Exam Braindumps (page: 6)

Page 6 of 36

A table named "sample" is defined as below. Select two statements which will generate a
constraint error.
CREATE TABLE sample (
i INTEGER PRIMARY KEY,
j INTEGER,
CHECK ( i > 0 AND j < 0 )
);

  1. INSERT INTO sample VALUES (1, 0);
  2. INSERT INTO sample VALUES (2, -2);
  3. INSERT INTO sample VALUES (3, NULL);
  4. INSERT INTO sample VALUES (NULL, -4);
  5. INSERT INTO sample VALUES (5, -5);

Answer(s): A,D



The following is the result of executing the createlang command which is installed with PostgreSQL.
$ createlang -U postgres --list mydb
Procedural Languages
Name | Trusted?
---------+----------
plpgsql | yes
Select two correct statements from below.

  1. The procedural language plpgsql is installed in the database mydb using the above command.
  2. The procedural language plpgsql can be used in the database mydb.
  3. plpgsql is a trusted language, so it can execute the OS commands on the server side.
  4. plpgsql is a trusted language, so it can read/write OS files on the server side.
  5. plpgsql is a safe language with restricted operations.

Answer(s): B,E



Given the following two table definitions, select one SQL statement which will cause an error. CREATE TABLE sample1 (id INTEGER, data TEXT);
CREATE TABLE sample2 (id INTEGER);

  1. SELECT id AS data, data FROM sample1;
  2. SELECT id, id FROM sample1;
  3. SELECT s1.id, s2.id FROM sample1 AS s1, sample1 AS s2;
  4. SELECT s1.id, s2.id FROM sample1 s1, sample2 s2;
  5. SELECT s1.id, s2.data FROM sample1 s1, sample2 s2;

Answer(s): E



Select two suitable statements regarding creating a new table.

  1. There is no upper limit to the number of columns in a table.
  2. A newly created table is empty and has 0 rows.
  3. You can only use alphabetic characters for a table name.
  4. The row name must be within 16 characters.
  5. The SQL 'CREATE TABLE' statement is used to create a new table.

Answer(s): B,E



Page 6 of 36



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

Gabe commented on January 02, 2020
easy check out
UNITED STATES
upvote