nerdexam
PostgreSQL_CE

PGCES-02 · Question #45

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 ----+-----------------+…

The correct answer is A. 0 rows. See the full explanation below for the reasoning.

Question

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 | [email protected] | 1 3 | [email protected] | 2 4 | [email protected] | 2 Three SQL statements were executed in the following order:

UPDATE custom SET email = '' FROM custom c WHERE custom.introducer = c.id; UPDATE custom SET introducer = NULL WHERE introducer NOT IN (SELECT id FROM custom); DELETE FROM custom WHERE id = 2 OR introducer = 2; PostgreSQL CE PGCES-02 Exam Select the number of rows in the "custom" table after the execution.

Options

  • A0 rows
  • B1 row
  • C2 rows
  • D3 rows
  • E4 rows

How the community answered

(59 responses)
  • A
    76% (45)
  • B
    14% (8)
  • C
    5% (3)
  • D
    2% (1)
  • E
    3% (2)

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice