Multiple Choice Questions on SQL Where Clause
1. Which one is correct syntax for Where clause in SQL server?
a) SELECT WHERE "Condition" Col1, Col2 FROM "Table" ;
b) SELECT "Condition" Col1, Col2 FROM "Table" WHERE;
c) SELECT Col1, Col2 FROM "Table" WHERE "condition";
d) None of the above
2. What can be the condition in where clause in a SQL query?
a) Condition that is to be met for the rows to be returned from result.
b) Boolean Condition only
c) Text condition only
d) None of the above
3. Is there any limit for number of predicates/conditions to be added in a Where clause?
a) True
b) False
4. What is the purpose of Order By Clause in SQL server?
a) It is used to sort the result.
b) It is used to change sequence order of columns
c) It can’ be used in SQL Server
d) None of the above
5. Order by can only be used by Where Clause, correct?
a) True
b) False
6. What needs to be added when user want to show results by Descending Order?
a) Descending order cannot be possible.
b) User can add DESC with Order By clause
c) User can add ‘<>ASC’ with Order by Clause.
d) None of the above
7. What is the default order of Order by Clause?
a) Descending
b) Ascending
c) Random
d) None of the above
8. Among the below Order By queries, which are correct ones?
a) SELECT * FROM Table Order By Column;
b) SELECT * FROM Table Order By Column ASC;
c) SELECT * FROM Table Order By Column DESC;
d) SELECT * FROM Table Order By (n); --Where n is any column sequence number in a table
e) All of the above
f) None of the above
9. Is it possible to have both Orders (i.e. ASC/DESC) in a single query?
a) True
b) False
10. Can ‘IN’ operator be used with Where clause?
a) True
b) False
Answers