nerdexam
PostgreSQL_CE

PGCES-02 · Question #141

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

The correct answer is B. INSERT INTOfmaster VALUES (1, 'itemB'); C. DELETE FROMfmaster. See the full explanation below for the reasoning.

Question

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 the two SQL statements that will generate an error when executed next.

Options

  • ADROP TABLEftrans;
  • BINSERT INTOfmaster VALUES (1, 'itemB');
  • CDELETE FROMfmaster;
  • DUPDATEfmaster SET name = NULL;
  • EINSERT INTOftrans VALUES (1, 2, NULL);

How the community answered

(40 responses)
  • A
    8% (3)
  • B
    78% (31)
  • D
    3% (1)
  • E
    13% (5)

Community Discussion

No community discussion yet for this question.

Full PGCES-02 Practice