Multiple Choice Questions - SQL Where / Order by Clause

Multiple Choice Questions - SQL Where / Order by Clause


1. Which one is correct syntax for Where clause in SQL server?

a) SELECT WHERE Col1, Col2 FROM ;
b) SELECT Col1, Col2 FROM WHERE;
c) SELECT Col1, Col2 FROM
WHERE;
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 Order By ;
b) SELECT * FROM Order By ASC;
c) SELECT * FROM Order By DESC;
d) SELECT * FROM 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