nerdexam
PostgreSQL_CE

PGCES-02 · Question #19

PGCES-02 Question #19: Real Exam Question with Answer & Explanation

Sign in or unlock PGCES-02 to reveal the answer and full explanation for question #19. The question stem and answer options stay visible for context.

Question

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;';

Options

  • AAn error is generated unless theplpgsql language is registered in the database beforehand.
  • BThe execution results of SELECTmyfunc(-123) differs based on the content of "mytable".
  • CWhen SELECTmyfunc(123) is executed an error occurs.
  • DWhen SELECTmyfunc(NULL) is executed an error occurs.
  • EWhen SELECTmyfunc (0) is executed the text "default" is returned.

Unlock PGCES-02 to see the answer

You've previewed enough free PGCES-02 questions. Unlock PGCES-02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full PGCES-02 Practice