MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following query returns the results in ascending order of the experience column?
A
SELECT experience, name FROM DataFlair;
B
SELECT name, experience FROM DataFlair;
C
SELECT name, experience FROM DataFlair Order By name ASC;
D
SELECT experience, name FROM DataFlair Order By experience ASC;
Explanation: 

Detailed explanation-1: -The ORDER BY statement in SQL is used to sort the fetched data in either ascending or descending according to one or more columns. By default ORDER BY sorts the data in ascending order. We can use the keyword DESC to sort the data in descending order and the keyword ASC to sort in ascending order.

Detailed explanation-2: -The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.

Detailed explanation-3: -The ORDER BY clause must come after the WHERE, GROUP BY, and HAVING clause if present in the query. Use ASC or DESC to specify the sorting order after the column name. Use ASC to sort the records in ascending order or use DESC for descending order.

There is 1 question to complete.