Quiz de SQL: ORDER BY & LIMIT

This SQL quiz covers ORDER BY and LIMIT, the clauses behind every "top 5" or "cheapest first" list. You will predict sorted results, break ties with a second column and page through rows with OFFSET.

Fácil 10 perguntas ~5 minutos Aprovação com 80% SQLite

Escolha um modo

Jogando como visitante: entre para guardar seu XP e sua sequência.

Pergunta de exemplo

Pergunta 1 de 10

What does this query return?

CREATE TABLE products (name TEXT, price INTEGER);
INSERT INTO products VALUES ('Pen', 2), ('Book', 12), ('Mug', 8), ('Lamp', 25), ('Cup', 8);
SELECT name FROM products ORDER BY price LIMIT 1;
Mostrar a resposta

B. Pen ORDER BY price sorts from lowest to highest, and LIMIT 1 keeps only the first row, the cheapest product.

O que este quiz cobre

  • Sorting with ORDER BY, ASC and DESC
  • Breaking ties with a second sort column
  • Keeping the first rows with LIMIT and skipping rows with OFFSET
  • Sorting by a column alias or position
  • Why LIMIT without ORDER BY gives no guaranteed rows

Perguntas frequentes

Preciso de uma conta?

Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.

Posso refazer?

Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.