Which of the following statement contains an error?
2022
Which of the following statement contains an error?
- A.
Select * from emp where empid = 10003;
- B.
Select empid from emp where empid = 1006;
- C.
Select empid from emp;
- D.
Select empid where empid = 1009 and last_name = 'GELLER';
Attempted by 1877 students.
Show answer & explanation
Correct answer: D
In SQL, the FROM clause is mandatory when selecting data from a table. Option (D) is missing the FROM emp clause, hence it is syntactically incorrect. All other statements are valid SQL queries.