nerdexam
PostgreSQL_CE

PGCES-02 · Question #137

PostgreSQL CE PGCES-02 Exam 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…

The correct answer is C. (3). See the full explanation below for the reasoning.

Question

PostgreSQL CE PGCES-02 Exam 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.

Options

  • A(1)
  • B(2)
  • C(3)
  • D(4)
  • ENo error is generated.

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    10% (3)
  • C
    80% (24)
  • E
    7% (2)

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice