Which keyword would you use to sort results in descending order by a column named 'score'?

Prepare for the IGCSE Algorithms and Pseudocode Exam. Study with comprehensive questions covering key algorithms and pseudocode techniques. Access hints and explanations to gear up for your exam success!

Multiple Choice

Which keyword would you use to sort results in descending order by a column named 'score'?

Explanation:
Sorting results in SQL is controlled by the ORDER BY clause, and the direction of that sort is specified by either ASC (ascending) or DESC (descending). To arrange by a column named score in descending order, you use the column after ORDER BY and add DESC to indicate the direction. For example: SELECT * FROM table ORDER BY score DESC. DESC is the keyword that makes the sort go from highest to lowest. Using ASC would flip it to ascending, and GROUP BY is for grouping rows, not sorting.

Sorting results in SQL is controlled by the ORDER BY clause, and the direction of that sort is specified by either ASC (ascending) or DESC (descending). To arrange by a column named score in descending order, you use the column after ORDER BY and add DESC to indicate the direction. For example: SELECT * FROM table ORDER BY score DESC. DESC is the keyword that makes the sort go from highest to lowest. Using ASC would flip it to ascending, and GROUP BY is for grouping rows, not sorting.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy