PostgreSQL_CE
PGCES-02 · Question #7
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. PostgreSQL CE PGCES-02 Exam
Data Management and SQL
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 FROMsample1 s1;
- BSELECT s1.id FROMsample1 AS s1;
- CSELECT data FROMsample1 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 WHERE s1.id = s2.id;
How the community answered
(53 responses)- A8% (4)
- B2% (1)
- C11% (6)
- D75% (40)
- E4% (2)
Explanation
PostgreSQL CE PGCES-02 Exam
Topics
#SQL#ambiguous column reference#table aliases#SELECT error
Community Discussion
No community discussion yet for this question.