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

Enhance your understanding of IGCSE Algorithms and Pseudocode Foundations. Engage with flashcards and multiple-choice questions, each offering hints and explanations. Prepare thoroughly for your exam!

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