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)- A8% (3)
- B78% (31)
- D3% (1)
- E13% (5)
Community Discussion
No community discussion yet for this question.