Quizzma Latest Questions

Which SQL clause is used to sort the result set of a query?

Which SQL clause is used to sort the result set of a query? a) WHERE
b) ORDER BY
c) GROUP BY
d) HAVING




Leave an answer

Leave an answer

What is the capital of Egypt? ( Cairo )

1 Answer

  1. The correct answer is b) ORDER BY.

    The `ORDER BY` clause is used in SQL to sort the result set of a query based on one or more columns. You can specify whether to sort the results in ascending (ASC) or descending (DESC) order. For example:

    
    

    SELECT * FROM students ORDER BY last_name ASC;

    This will sort the students by their last names in ascending order. If you have more questions or need further assistance, feel free to ask!

Related Questions