AllRounder.ai
Chapters in this course

Enrol to start learning

Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.

Enrol free

1.3. Sorting with ORDER BY

  • This section

    Practice test

    11 questions on this section. Wrong answers show you what to read again.

    Sign up to take it
  • Whole chapter

    Revision test

    Mixed questions from across the chapter. Your answers get marked.

    Sign up to take it
  • Quick

    Flashcard drill

    3 cards from this lesson. Good the night before a test.

Try these first

  1. 1.

    What does ORDER BY price ASC do?

    Hint

    Think about how you would organize prices in a list.

  2. 2.

    Write an SQL query to select all products sorted alphabetically by name.

    Hint

    Sort using the product name.

  3. 3.

    What does the SQL command ORDER BY do?

    • Sorts data
    • Filters data
    • Joins tables
    Hint

    Consider what we do to organize lists.

  4. 4.

    True or False: The ASC keyword sorts data in descending order.

    • True
    • False
    Hint

    Think about what 'ascending' means.

  5. 5.

    Write a SQL query that sorts a list of employees first by department alphabetically and then by their hire date in descending order.

    Hint

    Consider the order in which you want to arrange employees in a report.

  6. 6.

    Formulate a query that selects all products including their sales amount and sorts them by sales amount descending, but only for the available status.

    Hint

    Combine filtering with your sorting for clarity.

Exercises

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

4 more questions available

Enrol free

Quiz

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting

1 more question available

Enrol free

Challenge Problems

Total Questions

2

Estimated Time

4 min

Passing Score

70%

Instructions

  • Read each question carefully
  • You can use hints if you need help
  • Complete all questions before submitting