PostgreSQL_CE
PGCES-02 · Question #50
Given the following two table definitions, select one SQL statement which will cause an error. CREATE TABLE sample1 (id INTEGER, data TEXT); CREATE TABLE sample2 (id INTEGER);
The correct answer is D. SELECT id, data FROM sample1 AS s1, sample2 AS s2. See the full explanation below for the reasoning.
Question
Given the following two table definitions, select one SQL statement which will cause an error. CREATE TABLE sample1 (id INTEGER, data TEXT); CREATE TABLE sample2 (id INTEGER);
Options
- ASELECT s1.id FROM sample1 s1;
- BSELECT s1.id FROM sample1 AS s1;
- CSELECT data FROM sample1 AS s1, sample2 AS s2
- DSELECT id, data FROM sample1 AS s1, sample2 AS s2
- ESELECT s1.id, s1.data FROM sample1 AS s1, sample2 AS s2
How the community answered
(32 responses)- A9% (3)
- B3% (1)
- D84% (27)
- E3% (1)
Community Discussion
No community discussion yet for this question.