Квиз по SQL: INNER JOIN

This SQL quiz checks the basics of INNER JOIN: how the ON condition matches rows, why unmatched rows disappear and how repeated keys multiply results. You will read short queries, predict their output and pick the right join for a task.

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

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

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

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

Вопрос 1 из 10

How many rows does this join return?

CREATE TABLE customers (id INTEGER, name TEXT);
CREATE TABLE orders (id INTEGER, customer_id INTEGER, amount INTEGER);
INSERT INTO customers VALUES (1, 'Ann'), (2, 'Bob'), (3, 'Cy');
INSERT INTO orders VALUES (10, 1, 10), (11, 1, 20), (12, 3, 5);
SELECT COUNT(*)
FROM customers c
JOIN orders o ON o.customer_id = c.id;
Показать ответ

B. 3 Each order matches exactly one customer, so the join returns one row per order: 3. Bob has no orders, so an inner join has nothing to pair him with and he adds no rows.

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

  • What INNER JOIN ... ON returns
  • Why rows without a match are left out
  • Repeated keys and how they multiply rows
  • Table aliases and ambiguous column names
  • USING (column) and the old comma join

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

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

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

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

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