Академический Документы
Профессиональный Документы
Культура Документы
Question: 1
Select two suitable statements regarding the following SQL statement:
CREATE TRIGGER trigger_1 AFTER UPDATE ON sales FOR EACH ROW
EXECUTE PROCEDURE write_log();
Answer: A, E
Question: 2
Select two transaction isolation levels supported in PostgreSQL.
A. DIRTY READ
B. READ COMMITTED
C. REPEATABLE READ
D. PHANTOM READ
E. SERIALIZABLE
Answer: B, E
Question: 3
PostgreSQL can use an index to access a table. Select two incorrect statements about indexes.
Answer: D, E
Question: 4
Select two incorrect statements regarding 'DOMAIN'.
A. When defining a domain, you can add a default value and constraints to the original data.
B. Domain is a namespace existing between databases and objects such as tables.
C. A domain is created by 'CREATE DOMAIN'.
D. A domain can be used as a column type when defining a table.
E. To define a domain, both input and output functions are required.
Answer: B, E
Question: 5
Select two suitable statements regarding the data types of PostgreSQL.
Page 1 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A, D
Question: 6
The table "score" is defined as follows:
gid | score
-----+-------
1 | 70
1 | 60
2 | 100
3 | 80
3 | 50
The following query was executed. Select the number of rows in the result.
SELECT gid, max(score) FROM score
GROUP BY gid HAVING max(score) > 60;
A. 1 row
B. 2 rows
C. 3 rows
D. 4 rows
E. 5 rows
Answer: C
Question: 7
Table "t1" is defined as follows:
CREATE TABLE t1 (value VARCHAR(5));
A set of SQL statements were executed in the following order. Select the number of rows that
table "t1" has after execution.
BEGIN;
INSERT INTO t1 VALUES ('AA');
SAVEPOINT point1;
INSERT INTO t1 VALUES ('BB');
SAVEPOINT point2;
INSERT INTO t1 VALUES ('CC');
ROLLBACK TO point1;
INSERT INTO t1 VALUES ('DD');
END;
A. 1 row
B. 2 rows
C. 3 rows
D. 4 rows
E. 0 rows
Answer: B
Question: 8
Select two suitable statements about sequences.
A. A sequence always returns a 4-byte INTEGER type value, so the maximum value is
2147483647.
B. A sequence is defined by 'CREATE SEQUENCE', and deleted by 'DROP SEQUENCE'.
Page 2 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
C. Although the "nextval" function is called during a transaction, it will have no effect if that
transaction is rolled back.
D. A sequence always generates 0 or consecutive positive numbers.
E. A sequence number can be set by calling the "setval" function.
Answer: B, E
Question: 9
The "sample" table consists of the following data:
How many rows are returned by executing the following SQL statement?
SELECT DISTINCT ON (data) * FROM sample;
A. 2 rows
B. 3 rows
C. 4 rows D. 5 rows
E. 6 rows
Answer: B
Question: 10
The following SQL statements were executed using psql.
Select the appropriate statement about the result.
LISTEN sign_v;
BEGIN;
NOTIFY sign_v;
COMMIT;
LISTEN sign_v;
A. At the point that 'NOTIFY sign_v' is executed, a message that starts with "Asynchronous
notification 'sign_v' received" is output.
B. At the point that 'COMMIT' is executed, a message that starts with "Asynchronous notification
'sign_v' received" is output.
C. At the point that 'SELECT * FROM pg_user;" is executed, a message that starts with
"Asynchronous notification 'sign_v' received" is output.
D. When 'LISTEN sign_v' is executed for the second time, a message that starts with
"Asynchronous notification 'sign_v' received" is output.
E. The message "Asynchronous notification 'sign_v' received" is not received while in this
connection.
Answer: B
Question: 11
Select the correct SQL statement which concatenates strings 'ABC' and 'abc' to form 'ABCabc'.
Answer: E
Question: 12
Select two correct descriptions about views.
Page 3 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: B, C
Question: 13
Table "t1" is defined below.
Table "t1" has a column "id" of type INTEGER, and a column "name" of type TEXT.
t1:
The following SQL is executed while client "A" is connected.
BEGIN;
SELECT * FROM t1 WHERE id = 2 FOR UPDATE;
SELECT * FROM t1 WHERE id = 1 FOR UPDATE; -- (*)
While the second 'SELECT' statement, shown with (*), is being executed, a separate client "B"
connects and executes the following SQL.
Select the correct statement about the execution results.
UPDATE t1 SET name = 'turtle' WHERE id = 2;
Note: the default transaction isolation level is set to "read committed".
A. The update process for client "B" is blocked until the current connection for client "A" is
finished.
B. The update process for client "B" is blocked until the current transaction for client "A" is
finished.
C. The 'UPDATE' process for client "B" proceeds regardless of the condition of client "A".
D. The process of client "B" immediately generates an error.
E. The processes for both clients are blocked, and an error stating that a deadlock has been
detected is generated.
Answer: B
Question: 14
SQL statements were executed in the following order:
CREATE TABLE fmaster
(id INTEGER PRIMARY KEY, name TEXT);
CREATE TABLE ftrans
(id INTEGER REFERENCES fmaster (id), stat INTEGER, date DATE);
INSERT INTO fmaster VALUES (1, 'itemA');
INSERT INTO ftrans VALUES (1, 1, CURRENT_DATE);
Select two SQL statements that will generate an error when executed next.
Answer: A, C
Question: 15
Select three SQL statements which return NULL.
A. SELECT 0 = NULL;
Page 4 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A, B, D
Question: 16
The table "custom" is defined below.
The "id" column and "introducer" column are of INTEGER type, and the "email" column is of
TEXT type.
id | email | introducer
----+-----------------+------------
2 | aaa@example.com | 1
3 | bbb@example.com | 2
4 | ccc@example.com | 2
A. 0 rows
B. 1 row
C. 2 rows
D. 3 rows
E. 4 rows
Answer: C
Question: 17
The "sample" table consists of the following data:
How many rows are returned by executing the following SQL statement?
SELECT * FROM sample WHERE v ~ 'ab';
A. 0 rows
B. 1 row
C. 2 rows
D. 3 rows
E. 4 rows
Answer: C
Question: 18
Select an incorrect statement regarding the following SQL statement. Note that "user_view" is a
view.
CREATE OR REPLACE RULE rule_1 AS ON UPDATE TO user_view
DO INSTEAD NOTHING;
Page 5 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: D
Question: 19
The "animal" table consists of the following data:
Select the correct result returned by executing the following SQL statement:
SELECT name FROM animal ORDER BY weight DESC LIMIT 2 OFFSET 1;
A. A syntax error will occur.
Answer: A
Question: 20
Four SQL statements were executed in the following order.
CREATE TABLE foo (bar INT);
ALTER TABLE foo ALTER bar TYPE BIGINT;
ALTER TABLE foo ADD baz VARCHAR(5);
ALTER TABLE foo DROP bar;
Select two SQL statements that generate an error when executed.
Answer: B, D
Question: 21
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 )
);
Answer: A, D
Question: 22
The following is the result of executing the createlang command which is installed with
PostgreSQL.
$ createlang -U postgres --list mydb
Procedural Languages
Name | Trusted?
Page 6 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
---------+----------
plpgsql | yes
Select two correct statements from below.
A. The procedural language plpgsql is installed in the database mydb using the above command.
B. The procedural language plpgsql can be used in the database mydb.
C. plpgsql is a trusted language, so it can execute the OS commands on the server side.
D. plpgsql is a trusted language, so it can read/write OS files on the server side.
E. plpgsql is a safe language with restricted operations.
Answer: B, E
Question: 23
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);
Answer: E
Question: 24
Select two suitable statements regarding creating a new table.
Answer: B, E
Question: 25
The tables "t1" and "t2" are defined below.
The tables "t1" and "t2" have columns "id" which are type of INTEGER and column "name"s
which are type of TEXT.
t1
t2
The following SQL command was executed. Select the number of rows in the result.
SELECT * FROM t1 NATURAL FULL OUTER JOIN t2;
A. 2 rows
B. 3 rows
C. 4 rows
D. 5 rows
E. 6 rows
Answer: D
Question: 26
Select two suitable statements about major version upgrades of PostgreSQL from below.
Page 7 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: C, D
Question: 27
Select one incorrect statement concerning the relational data model.
Answer: D
Question: 28
Select two incorrect statements concerning PostgreSQL license.
Answer: D, E
Question: 29
Select the most suitable statement about PostgreSQL from below.
Answer: E
Question: 30
Select the most suitable statement about the PostgreSQL license from below.
Answer: D
Question: 31
Page 8 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: B
Question: 32
I would like to insert the contents of the text file users.dat into the table t1 using psql.
Contents of text file users.dat:
Definition of table t1:
CREATE TABLE t1 (uname TEXT, pass TEXT, id INTEGER);
Select the most appropriate input from those below.
Answer: A
Question: 33
Select one correct statement about the createlang command.
Answer: B
Question: 34
What does the following command do? Select two correct descriptions regarding this SQL
statement.
SELECT * FROM information_schema.tables;
Answer: A, D
Question: 35
Select two correct statements that describe what occurs on the client side when the following
command is executed.
pg_ctl -m smart stop
Page 9 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
B. The running transaction for a connected client is rolled back and the connection is
disconnected forcibly.
C. Connections are terminated after the currently running transactions have finished.
D. The processes of currently connected clients are processed normally.
E. Connected clients receive a message saying that the server will soon be shutdown.
Answer: A, D
Question: 36
Select two correct statements about the command shown below.
Note: $ is the command prompt.
$ pg_ctl reload
A. The command forces the content of pg_hba.conf to be re-read into PostgreSQL server
process.
B. The command temporarily stops the PostgreSQL server process and restart it.
C. The command re-reads the postgresql.conf details into the PostgreSQL server process and
changes the values of any configuration parameters that can be changed.
D. The command forces the content of the database cluster to be re-read into PostgreSQL
server process.
E. The command causes a recovery to be performed from a standard backup file in the
PostgreSQL server process.
Answer: A, C
Question: 37
I would like to set the default character encoding for the client to Unicode.
Select the most appropriate configuration parameter in postgresql.conf from those below.
A. backend_encoding = UNICODE
B. frontend_encoding = UNICODE
C. client_encoding = UNICODE
D. default_encoding = UTF8
E. encoding = UTF8
Answer: C
Question: 38
Select two correct statements about the command shown below.
Note: $ is the command prompt.
$ dropdb -U foo foodb
Answer: C, E
Question: 39
I would like to copy a database cluster directory for backup.
Select two incorrect statements from below.
Page 10 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
B. When using the Tablespace function, it is necessary to back up the directory that stores the
tablespace as well.
C. A database cluster that has been restored can be used on a separate machine with the same
structure.
D. A database cluster that has been restored can be used on a newer version of PostgreSQL.
E. A database cluster that has been restored can be used on an older version of PostgreSQL.
Answer: D, E
Question: 40
Select the correct command to collect and save the statistical information of a table.
A. ANALYZE
B. CLUSTER
C. REINDEX
D. STATISTIC COLLECTION
E. STATISTIC COLLECTOR
Answer: A
Question: 41
Choose the most suitable statement about user management of PostgreSQL.
Note: the version of PostgreSQL is 8.0.
Answer: D
Question: 42
I would like to enable all users to SELECT the "item" table.
Select the most appropriate SQL statement from below.
Answer: B
Question: 43
Configuration file pg_hda.conf is set as below on a host currently running
PostgreSQL.
local all all trust
host all all 192.168.1.0/24 reject
host all all 192.168.0.0/16 trust
Select a host IP address which is authorized to connect to this database via the network.
Note: INET domain socket communication is available.
Page 11 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
A. 127.0.0.1
B. 192.168.1.1
C. 192.168.0.1
D. 192.168.1.0
E. None can be connected.
Answer: C
Question: 44
Select one correct command to shutdown the postmaster AFTER all the clients have
disconnected.
A. pg_ctl stop
B. pg_ctl -m fast stop
C. pg_ctl -m immediate stop
D. pg_ctl -m wait stop
E. pg_ctl -s stop
Answer: A
Question: 45
Select the most appropriate setting to output the log messages of the database to syslog.
Answer: E
Question: 46
Select one option which cannot be specified using createdb.
A. Database locale
B. Character encoding
C. Host name
D. Database owner
E. Template database
Answer: A
Question: 47
You have just added an option "listen_addresses = 'localhost'" in
postgresql.conf. When will this setting take effect?
Answer: C
Page 12 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Question: 48
Select two suitable statements regarding the pg_dump command.
Answer: C, E
Question: 49
Based on the following request, select the most appropriate command for creating a database
cluster.
?Character encoding of the template database needs to be EUC_JP
?Locale is not used
Answer: D
Question: 50
Select the correct SQL statement that records the space occupied by deleted or updated rows for
later reuse, and also updates statistics.
A. VACUUM
B. VACUUM ANALYZE
C. EXPLAIN
D. EXPLAIN ANALYZE
E. NOTIFY
Answer: B
Question: 51
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');
A. 0
B. 1
C. 10
D. 11
E. -10
Answer: B
Question: 52
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;
Page 13 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
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;
Answer: B
Question: 53
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 + ________________ ;
A. '10 day'::timestamp
B. '10 day'::interval
C. 10::day
D. 8640000::time
E. age(8640000)
Answer: B
Question: 54
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,
_____________________
);
Answer: B
Question: 55
Page 14 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
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.
Answer: D
Question: 56
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".
A. The process for client "B" is blocked until the current connection for client "A" is finished.
B. The process for client "B" is blocked until the current transaction for client "A" is finished.
C. The process for client "B" will be deleted regardless of the condition of client "A".
D. The process of client "B" will affect the SELECT result of client "A".
E. The process of client "B" will not affect the SELECT result of client "A".
Answer: B, E
Question: 57
The "sample" table consists of the following data.
How many rows are returned by executing the following SQL statement?
SELECT i FROM sample GROUP BY i;
A. 1 row
B. 2 rows
C. 3 rows
D. 4 rows
E. 5 rows
Answer: C
Question: 58
The tables "t1" and "t2" are defined below.
Tables "t1" and "t2" have columns "id" that are of INTEGER type, and columns "name" that are of
TEXT type.
t1
t2
The following SQL command was executed. Select the number of rows in the result.
SELECT * FROM t1 RIGHT OUTER JOIN t2 ON t1.id = t2.id;
A. 2 rows
B. 3 rows
Page 15 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
C. 4 rows
D. 5 rows
E. 6 rows
Answer: B
Question: 59
Select the SQL command that must be executed prior to executing the
EXECUTE command.
A. CREATE FUNCTION
B. PREPARE
C. DECLARE
D. LOAD
E. ALLOCATE
Answer: B
Question: 60
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);
Answer: D
Question: 61
What happens if an SQL statement syntax error occurs while a transaction is running? Select the
correct action from below.
Answer: C
Question: 62
The table "tbl" is defined below such that it could only store non-negative integers in the column
"nn".
Select the keyword that is applicable for the underlined blank.
CREATE _______ natural_number AS DECIMAL CHECK (VALUE >= 0);
CREATE TABLE tbl(nn natural_number);
A. VIEW
Page 16 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
B. SCHEMA
C. RULE
D. TYPE
E. DOMAIN
Answer: E
Question: 63
In the "customer" table, you want to change the "email" values which have an "id" value of 10000
or less, to NULL. Select the correct SQL statement to achieve this task.
Answer: C
Question: 64
Select one incorrect description regarding the following SQL statement defining a function.
CREATE OR REPLACE FUNCTION get_file_list(TEXT, BOOLEAN)
RETURNS SETOF TEXT LANGUAGE C STRICT
SECURITY DEFINER AS 'myfuncs.so';
Answer: E
Question: 65
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);
A. RULE
B. VIEW
C. TRIGGER
D. FUNCTION
E. CONSTRAINT
Answer: A
Question: 66
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
Page 17 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
----+--------
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);
A. 1 row
B. 2 rows
C. 3 rows
D. 4 rows
E. 5 rows
Answer: B
Question: 67
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);
A. If any row exists in the "record" table, no change can be made to the "master" table.
B. 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.
C. If the "record" table contains a row with an "id", the corresponding "id" row in the "master"
table cannot be deleted.
D. The "record" table cannot have duplicate "id"s.
E. These SQL statements are invalid; no constraints are created.
Answer: C
Question: 68
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;
A. CURSOR
B. SCROLL CURSOR WITH HOLD
C. INSENSITIVE CURSOR
D. NO SCROLL CURSOR WITH HOLD
E. CURSOR WITHOUT HOLD
Answer: B
Question: 69
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);
Page 18 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: E
Question: 70
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;
Answer: D
Question: 71
Select the correct SQL statement to define a new data type.
A. CREATE CLASS
B. CREATE FUNCTION
C. CREATE OPERATOR
D. CREATE DATABASE
E. CREATE TYPE
Answer: E
Question: 72
Select two appropriate statements from below about the following SQL statements:
CREATE FUNCTION myfunc(INTEGER) RETURNS text LANGUAGE plpgsql STRICT AS '
DECLARE
x ALIAS FOR $1;
r text := ''default'';
BEGIN
IF x > 100 THEN
SELECT INTO r data FROM mytable WHERE id = x;
END IF;
RETURN r;
END;';
A. An error is generated unless the plpgsql language is registered in the database beforehand.
B. The execution results of SELECT myfunc(-123) differs based on the content of "mytable".
C. When SELECT myfunc(123) is executed an error occurs.
D. When SELECT myfunc(NULL) is executed an error occurs.
E. When SELECT myfunc (0) is executed the text "default" is returned.
Page 19 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A, E
Question: 73
The table "t1" is defined by the following SQL statement:
CREATE TABLE t1 (id integer, name varchar(20));
You want to increase the execution speed of the SQL statement below:
SELECT id, name FROM t1 WHERE id < 123 AND upper(name) = 'MAMMOTH';
Select the most suitable SQL statement to create an index.
Answer: A
Question: 74
The tables "t1" and "t2" are defined in the same way (they have the same data types and column
names). You want to select rows in "t1" which are not in "t2".
Select a correct keyword to fill in the blank below.
SELECT * FROM t1 ______ SELECT * FROM t2;
A. EXCEPT
B. UNION
C. NAND
D. INTERSECT
E. INTERSECT ALL
Answer: A
Question: 75
Select two suitable statements about the BSD license from below.
A. If you make changes to the source code, feedback must be sent to the original developers.
B. It is used by open source software.
C. User registration is required.
D. It is defined by Free Software Foundation, Inc. (FSF).
E. Software under the BSD license can be incorporated with any programs provided that the
copyright notice appears in all copies.
Answer: B, E
Question: 76
Which normal form has the constraint that there must be no tables with duplicate column values
in the same row?
Answer: A
Page 20 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Question: 77
Select one incorrect statement concerning changes from PostgreSQL version 7.4 to 8.0.
Answer: D
Question: 78
Select one false statement about the benefits of using database management systems from
below.
A. You can separate the data storage method from the application.
B. You can separate the data search method from the application.
C. You can separate the data display method from the application.
D. You can reduce the programming workload of programming for managing data.
E. You can share data more easily on systems consisting of multiple computers.
Answer: C
Question: 79
Select two incorrect statements about the Point-In-Time Recovery (PITR) from below.
A. This is a backup method integrating a physical backup and a transaction log (WAL).
B. It is necessary to stop the database server to perform a backup for the first time.
C. Updated data is continuously saved.
D. A restore can be performed to any arbitrary point in time since the starting point of PITR.
E. A backup can only be performed on a per-database basis.
Answer: B, E
Question: 80
Select one incorrect description about changing the settings of PostgreSQL during operation.
A. The current value of a parameter can be confirmed using the SHOW command.
B. All of the current settings can be displayed using the SHOW ALL command.
C. Changes that can be made using the SET command have higher priority than ones in
postgresql.conf.
D. Values set by a superuser using the SET command are valid for different connections made
later.
E. There are parameters that can not be set using the SET command
Answer: D
Question: 81
Which psql command do you need to execute to display the list of tables in the currently
connected database?
Page 21 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
D. \dt "database_name"
E. \dt
Answer: E
Question: 82
The following table called 'company' is defined as follows:
id | name
----+------------------
1 | Pgsql,inc.
2 | Postgres Co.,Ltd
3 | SQL Company.
Select the most appropriate psql command for generating a text file company.txt on the client side
with the following content:
1,"Pgsql,inc."
2,"Postgres Co.,Ltd"
3,SQL Company.
Answer: E
Question: 83
Select the most suitable statement regarding PostgreSQL's pg_hba.conf configuration file.
Answer: D
Question: 84
I would like to restore the database cluster from the "db1.dump" backup file.
Select the correct command from below. (Note: "postgres" is the superuser)
Answer: D
Question: 85
Select two incorrect statements concerning the system catalog.
Page 22 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: C, E
Question: 86
What does the following command do? Select the correct description from below.
Note: "text=#" is the command prompt for psql.
test=# ANALYZE foo;
Answer: B
Question: 87
What phenomenon occurs if PostgreSQL is used without performing VACUUM ?
Select two appropriate descriptions from those below.
A. Performance is reduced.
B. It gradually gets to the point where connections are denied.
C. The physical size of the database increases considerably in size.
D. Only SELECT queries will be accepted.
E. An e-mail prompting the administrator to perform VACUUM is sent from PostgreSQL.
Answer: A, C
Question: 88
Select the most appropriate statement about the initdb command.
Answer: A
Question: 89
Select the most suitable statement about the creation of a new database.
Answer: E
Page 23 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Question: 90
What does the following command do? Choose two incorrect statements from the selection
below.
Note: $ is the command prompt.
$ pg_restore -U postgres -d database1 database1.dump
A. This command restores the database database1 from the file database1.dump.
B. This command connects to a database as the user 'postgres'.
C. This command can not be executed unless the postmaster is running.
D. This command can not restore large objects.
E. This command must be executed under the condition where the database database1 does
not exist.
Answer: D, E
Question: 91
Select one incorrect statement about the command shown below.
Note: $ is the command prompt.
$ dropuser -U admin foo
Answer: B
Question: 92
Select an appropriate command to check the PostgreSQL version in psql.
A. \server_version
B. SELECT version;
C. SELECT version();
D. SHOW version;
E. SHOW server;
Answer: C
Question: 93
I would like to check the privileges on the "items" table in psql. Select the most appropriate
command.
A. \a items
B. \d items
C. \t items
D. \p items
E. \z items
Answer: E
Question: 94
What does the following command do? Choose the most appropriate statement from the
selection below.
Page 24 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A
Question: 95
The following are statements related to the postmaster. Select one statement that is incorrect.
Answer: C
Question: 96
It is possible to backup a database cluster by copying the entire data directory. Select two
suitable descriptions regarding this backup method.
Answer: B, E
Question: 97
Select two incorrect statements related to the command below.
Note: $ is the command prompt.
$ psql -U foo -c "COPY company TO stdout;" bar
Answer: B, D
Question: 98
I want to restore data from a text format backup file foo.dump.
Select an appropriate command.
Page 25 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: D
Question: 99
Select the most suitable statement about PostgreSQL from below.
A. There are PostgreSQL GPL license versions and commercial license versions.
B. You need to be pre-registered to use PostgreSQL.
C. PostgreSQL can be used by everyone free of charge for any purpose, be it private,
commercial, or academic.
D. You can use PostgreSQL for free; however, the source code is not open to the public.
E. PostgreSQL is shareware.
Answer: C
Question: 100
Based on the relationship of columns within a table, select the most suitable description that
shows that column A is dependent on column B.
Answer: B
Question: 101
The following question concerns the use of multibyte characters in PostgreSQL.
Select two correct items about character encoding in PostgreSQL.
Answer: C, E
Question: 102
From the SQL commands below, select one that is generally classified as "DDL".
A. START TRANSACTION
B. CREATE TABLE
C. SELECT
D. INSERT
E. DELETE
Answer: B
Page 26 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Question: 103
The table "foo" is defined as follows:
CREATE TABLE foo (bar TEXT);
Next, four SQL statements were executed in the following order.
INSERT INTO foo VALUES ('bar'); -------- (1)
ALTER TABLE foo ADD COLUMN c1 TEXT; ---- (2)
ALTER TABLE foo ADD UNIQUE (c1); ------- (3)
ALTER TABLE foo DROP COLUMN bar; ------- (4)
Select the correct statement from those below.
Answer: E
Question: 104
A set of tables are defined as follows:
t1
t2
How many rows are returned by executing the following SQL statement?
SELECT * FROM t1
WHERE EXISTS (SELECT name FROM t2 WHERE t1.id = t2.id);
A. 0 rows
B. 2 rows
C. 3 rows
D. 5 rows
E. 6 rows
Answer: B
Question: 105
SQL statements were executed in the following order.
CREATE TABLE book (
id VARCHAR(21), title TEXT NOT NULL, price INT,
UNIQUE (id), CHECK (price > 0)
);
INSERT INTO book VALUES ('4-12345-678-9', 'SQL book', 2300); --(1)
INSERT INTO book (title, price) VALUES ('PostgreSQL', 3000); --(2)
UPDATE book SET id = '4-12345-678-9' WHERE id IS NULL; --(3)
DELETE FROM book WHERE price < 0; --(4)
While executing, select the first location that generates an error.
A. (1)
B. (2)
C. (3)
D. (4)
E. No error is generated.
Answer: C
Page 27 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Question: 106
Select one incorrect statement concerning the following SQL statement.
CREATE OR REPLACE VIEW sales_view
AS SELECT * FROM sales_table ORDER BY sales_date DESC LIMIT 10;
Answer: D
Question: 107
A set of tables are defined as follows:
t1
t2
How many rows are returned by executing the following SQL statement?
SELECT * FROM t1 LEFT OUTER JOIN t2 USING (id);
A. 2 rows
B. 3 rows
C. 4 rows
D. 5 rows
E. 6 rows
Answer: C
Question: 108
Table t1 is defined as follows:
CREATE TABLE t1 (value VARCHAR(5));
A set of SQL statements were executed in the following order. Select the number of rows that
table "t1" has after execution.
BEGIN;
INSERT INTO t1 VALUES ('A');
SAVEPOINT sp;
INSERT INTO t1 VALUES ('B');
ROLLBACK TO sp;
INSERT INTO t1 VALUES ('C');
COMMIT;
A. 1 row
B. 2 rows
C. 3 rows
D. 4 rows
E. 0 rows
Answer: B
Question: 109
SQL statements were executed in the following order:
CREATE TABLE fmaster
(id INTEGER PRIMARY KEY, name TEXT);
Page 28 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: B, C
Question: 110
The table "t1" is defined below.
The column "id" for table "t1" is of INTEGER type.
id | name
----+------------
1 | mammoth
2 | tortoise
3 | coelacanth
The following SQL statements were executed. Select the correct statement about the execution
result.
BEGIN;
DECLARE c SCROLL CURSOR FOR SELECT name FROM t1 ORDER BY id;
MOVE FORWARD 2 FROM c;
FETCH FORWARD ALL FROM c;
COMMIT;
Answer: B
Question: 111
Select two incorrect statements regarding large objects.
Answer: C, E
Question: 112
Select two incorrect descriptions regarding the following SQL statements.
CREATE TABLE cities (
name text,
Page 29 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
population float
);
CREATE TABLE capitals (
state char(2)
) INHERITS (cities);
Answer: C, E
Question: 113
Select two SQL statements which abort a transaction.
A. END
B. ROLLBACK
C. TRUNCATE
D. ABORT
E. DROP TRANSTACTION
Answer: B, D
Question: 114
The table "custom" is defined below.
The "id" column and "introducer" column are of INTEGER type, and the "email" column is of
TEXT type.
id | email | introducer
----+-----------------+------------
2 | aaa@example.com | 1
3 | bbb@example.com | 2
4 | ccc@example.com | 2
A. 0 rows
B. 1 row
C. 2 rows
D. 3 rows
E. 4 rows
Answer: A
Question: 115
The "sample" table consists of the following data:
Page 30 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
How many rows are returned by executing the following SQL statement?
SELECT i FROM sample GROUP BY i HAVING count(*) = 2;
A. 0 rows
B. 1 row
C. 2 rows
D. 3 rows
E. 4 rows
Answer: C
Question: 116
A table is defined as follows:
CREATE TABLE t (id INT, val TEXT);
Select two correct statements from below about the function "get_head" defined below.
CREATE FUNCTION get_head(BOOLEAN)
RETURNS TEXT LANGUAGE sql CALLED ON NULL INPUT
AS 'SELECT val FROM t WHERE $1 OR id > 0 ORDER BY id LIMIT 1;';
Answer: D, E
Question: 117
A set of tables are defined as follows:
t1
t2
How many rows are returned by executing the following SQL statement?
SELECT t1.name FROM t1 CROSS JOIN t2;
A. 0 rows
B. 2 rows
C. 3 rows
D. 5 rows
E. 6 rows
Answer: E
Question: 118
The table "score" is defined as follows:
gid | score
-----+-------
1 | 70
1 | 60
2 | 100
3 | 80
3 | 50
Page 31 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
The following query was executed. Select the correct result value.
SELECT score FROM score ORDER BY gid DESC, score ASC LIMIT 1;
A. 50
B. 60
C. 70
D. 80
E. 100
Answer: A
Question: 119
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);
Answer: D
Question: 120
A set of tables are defined as follows:
t1
t2
How many rows are returned by executing the following SQL statement?
SELECT * FROM t1 UNION ALL SELECT * FROM t2;
A. 2 rows
B. 3 rows
C. 4 rows
D. 5 rows
E. An error will occur.
Answer: D
Question: 121
Select one incorrect statement about schemas.
Answer: C
Question: 122
Select two incorrect statements concerning the BOOLEAN type in PostgreSQL.
Page 32 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A, E
Question: 123
Select an incorrect statement regarding prepared statements, and 'PREPARE' / 'EXECUTE'
commands.
Answer: C
Question: 124
Select one statement which will cause a syntax error.
Answer: B
Question: 125
Select two incorrect statements regarding 'TRIGGER'.
A. When UPDATE is executed to the table, the specified function can be called.
B. When INSERT is executed to the table, the specified function can be called.
C. When SELECT is executed to the table, the specified function can be called.
D. A trigger can be set up to call a specified function before or after the event occurs.
E. A corresponding rule is automatically created when a trigger is created.
Answer: C, E
Question: 126
The following table called company is defined as follows:
id | name
----+------------------
1 | Pgsql,inc.
2 | Postgres Co.,Ltd
3 | SQL Company.
Page 33 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Select the most appropriate psql command for generating a text file company.txt with the
following content on the client side.
1,Pgsql \,inc.
2,Postgres Co. \,Ltd
3,SQL Company.
Answer: C
Question: 127
What does the following command do? Choose one incorrect statement from the selection below.
$ pg_dumpall -U postgres > 20060601.bak
Answer: B
Question: 128
Select one incorrect statement about the SQL COPY command.
Answer: B
Question: 129
Select two incorrect statements about the function of the information schema.
Answer: D, E
Question: 130
I would like to be able to save log entries as shown below. Select a correct configuration setting
from statements below.
LOG: connection received: host=[local] port=
LOG: connection authorized: user=postgres database=test
Page 34 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
A. syslog = true
B. log_connections = true
C. log_authorization = true
D. log_hostname = true
E. log_min_level = log
Answer: B
Question: 131
Select two suitable statements about postgresql.conf configuration.
Answer: C, E
Question: 132
Select two commands below from which privileges cannot be changed by the GRANT and
REVOKE statements.
A. SELECT
B. VACUUM
C. DELETE
D. TRIGGER
E. DROP
Answer: B, E
Question: 133
Select two correct statements about the command shown below.
Note: $ is the command prompt.
$ vacuumdb -az
Answer: A, B
Question: 134
Select two commands used to check the syntax of the ALTER TABLE statement in psql.
A. \h ALTER TABLE
B. \h ALTER
C. \ ALTER TABLE
D. \ ALTER
Page 35 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: A, B
Question: 135
Select one incorrect statement from the below about a database cluster.
Answer: C
Question: 136
Select one SQL statement that will cause an error.
A. SELECT version;
B. SELECT current_user;
C. SELECT current_date;
D. SELECT current_timestamp;
E. SELECT current_database();
Answer: A
Question: 137
Select two statements that the command below DOES NOT do.
Note: $ is the command prompt.
$ pg_dump -b -F c b > d
A. Backs up the "b" database to the "c" file, and stores error messages to the "d" file.
B. Backs up the "b" database to the "d" file.
C. Backs up large objects.
D. Backs up the "c" database to the "d" file as the "c" user.
E. Creates a backup, which is restorable with the pg_restore command.
Answer: A, D
Question: 138
A pg_hba.conf file is set up as follows.
local all all md5
host all all 127.0.0.1/32 md5
host all all 172.16.1.0/24 md5
When user foo connects to database bar from host IP address 172.16.1.2, I would like password
verification to not be performed.
Select one appropriate line for the new pg_hba.conf file.
Page 36 of 37
Exam Name: PostgreSQL CE 8 Silver
Exam Type: PostgreSQL CE
Exam Code: PGCES-02 Total Questions: 142
Answer: B
Question: 139
Select two suitable statements regarding a postmaster process.
Answer: A, C
Question: 140
Select a correct SQL command to change existing user "george"'s password to "foobar".
Answer: A
Question: 141
psql generated the following error message:
psql: could not connect to server: Connection was refused
Is the server running on host "server.example.com" and accepting
TCP/IP connections on port 5432?
Select two reasons that are NOT the cause of this error.
Answer: A, E
Question: 142
Select two correct statements from below concerning the ANALYZE command.
Answer: A, D
Page 37 of 37