PostgreSQL-CE PostgreSQL CE 8 Silver - PGCES-02 Exam Practice Test
Select one statement which will cause a syntax error.
Correct Answer: B
What happens if an SQL statement syntax error occurs while a transaction is running? Select the
correct action from below.
correct action from below.
Correct Answer: E
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;
Select the appropriate statement about the result.
LISTEN sign_v; BEGIN; NOTIFY sign_v;
COMMIT; LISTEN sign_v;
Correct Answer: E
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 HAVING count(*) = 2;
How many rows are returned by executing the following SQL statement? SELECT i FROM sample
GROUP BY i HAVING count(*) = 2;
Correct Answer: A
I would like to check the privileges on the "items" table in psql. Select the most appropriate command.
Correct Answer: B
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;';
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;';
Correct Answer: C,D
Which psql command do you need to execute to display the list of tables in the currently connected database?
Correct Answer: A