What is the SQL keyword used to sort the result set in descending order?OptionsSORTDESCASCORDER
Question
What is the SQL keyword used to sort the result set in descending order?
Options
SORT
DESC
ASC
ORDER
Solution
Answer
The SQL keyword used to sort the result set in descending order is DESC.
When you execute a query and need the results sorted in a specific order, you typically use the ORDER BY
clause. To sort the results in descending order, you would append DESC
to the column name in the ORDER BY
clause.
For example, if you want to sort a table by a column named age
in descending order, the SQL query would look like this:
SELECT * FROM your_table
ORDER BY age DESC;
In this context, SORT
, ASC
, and ORDER
are not valid keywords for this purpose. SORT
and ORDER
are generally not used in standard SQL syntax, while ASC
is used for ascending order sorting, which is the opposite of what is requested.
Therefore, the correct option is DESC.
Similar Questions
What is the SQL keyword used to sort the result set in descending order?OptionsSORTDESCASCORDER
Which SQL clause is used to sort the result set in descending order based on one or more columns?
Which one of the following construct is used for sorting the data in the result set of SQL queries?
The task of arranging data in order is calledA OrderingB SearchingC SortingD Ascending
In SQL, which clause is used to filter rows from a table?OptionsSORT BYWHEREGROUP BYFILTER
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.