165k views
3 votes
In an SQL query, which SQL keyword is used to sort the result table by the values in one or more columns?

a) GROUP BY
b) ORDER BY
c) SELECT
d) SORT BY
e) WHERE

1 Answer

6 votes

Final answer:

The SQL keyword used to sort the result table by the values in one or more columns is ORDER BY.

Step-by-step explanation:

The SQL keyword used to sort the result table by the values in one or more columns is ORDER BY.

For example, to sort a table 'students' by the name column in ascending order, you would use the following SQL query

SELECT FROM students ORDER BY name ASC

This query will return the rows from the students table in alphabetical order based on the values in the 'name' column.

User Diego Castro
by
8.0k points