Which clause sorts the result set by one or more columns?

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 clause sorts the result set by one or more columns?

Explanation:
Sorting the results of a query is controlled by a clause called ORDER BY. It specifies one or more columns to use as sort keys and can set the direction for each, ASC by default or DESC for descending. When multiple columns are listed, the first key determines the primary order, and any ties are broken by the next key, and so on. This is exactly what sorts the result set by one or more columns. Other clauses have different jobs: SELECT chooses which columns to display, WHERE filters which rows are included, and FROM selects the data source. They don’t determine the order of the rows unless paired with ORDER BY somewhere in the statement.

Sorting the results of a query is controlled by a clause called ORDER BY. It specifies one or more columns to use as sort keys and can set the direction for each, ASC by default or DESC for descending. When multiple columns are listed, the first key determines the primary order, and any ties are broken by the next key, and so on. This is exactly what sorts the result set by one or more columns.

Other clauses have different jobs: SELECT chooses which columns to display, WHERE filters which rows are included, and FROM selects the data source. They don’t determine the order of the rows unless paired with ORDER BY somewhere in the statement.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy