Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Basic Sorting | Sorting Data
Introduction to SQL
course content

Conteúdo do Curso

Introduction to SQL

Introduction to SQL

1. Getting Started
3. Sorting Data
4. Populating a Database
5. Updating & Deleting Data

book
Basic Sorting

Note

The rows fetched by a SELECT statement are ordered by default based on the date and time of insertion, with the oldest inserted row at the top and the most recently inserted row at the bottom. In the upcoming sections, we will learn how to insert rows into tables.

Summary:

  • We can sort the results of a SELECT statement by using an ORDER BY clause;
  • The syntax of the ORDER BY clause is: ORDER BY column_name [ASC|DESC];
  • The keywords ASC or DESC can be optionally used to specify the sorting order;
  • Usage Example: SELECT * FROM students ORDER BY age DESC.

1. Which clause can be used for ordering the retrieved data?

2. What is the correct syntax for using the ORDER BY clause?

Which clause can be used for ordering the retrieved data?

Which clause can be used for ordering the retrieved data?

Selecione a resposta correta

question-icon

What is the correct syntax for using the ORDER BY clause?

Clique ou arraste solte itens e preencha os espaços

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1
We're sorry to hear that something went wrong. What happened?
some-alt