Квиз по SQL: GROUP BY

This SQL quiz checks how GROUP BY turns rows into one result row per group. You will predict grouped totals, group by several columns, see how WHERE changes groups and learn which columns are allowed in the SELECT list.

Средний 10 вопроса ~6 минуты Проходной балл: 80% SQLite

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

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

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

Вопрос 1 из 10

What does this query return?

CREATE TABLE sales (region TEXT, rep TEXT, amount INTEGER);
INSERT INTO sales VALUES ('North', 'Ana', 100), ('South', 'Ben', 200), ('North', 'Cy', 50), ('South', 'Ana', 70), ('East', 'Dee', 30);
SELECT region, SUM(amount) FROM sales GROUP BY region ORDER BY region;
Показать ответ

A. East|30 North|150 South|270 GROUP BY region makes one group per region and SUM(amount) is computed inside each group: North 100 + 50, South 200 + 70, East 30.

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

  • One result row per group with GROUP BY
  • Aggregates per group like SUM, COUNT and AVG
  • Grouping by more than one column
  • WHERE filters rows before they are grouped
  • Which columns can appear in SELECT next to GROUP BY

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

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

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

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

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