Квиз по 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.

Лёгкий 10 вопроса ~5 минуты Проходной балл: 80% SQLite

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 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;
Показать ответ

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

Что проверяет этот квиз

  • 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

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.