Discussion
Which of the following is the correct order of keywords for SQL SELECT statements?
Answer: A
Correct answer: SELECT, FROM, WHERE
The written order is SELECT, then FROM, then WHERE, and it is fixed - the clauses cannot be rearranged.
Worth knowing is that the logical order of evaluation is different: FROM first to establish the source, then WHERE to filter rows, then GROUP BY and HAVING, and only then SELECT to choose columns, with ORDER BY last. That is why a column alias defined in SELECT cannot be used in WHERE: at that point it does not yet exist.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development