SQL Output Prediction

This SQL quiz shows short queries and asks what they return, the way many interviews do. It tests integer division, string concatenation, counting, ON vs WHERE in joins, UNION and the order SQL clauses really run in.

Médio 10 perguntas ~6 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 print in SQLite?

SELECT 7 / 2;
Mostrar a resposta

B. 3 Dividing two integers gives an integer in SQLite and PostgreSQL, so the fraction is cut off. MySQL's / always returns a decimal (3.5000); write 7 / 2.0 or CAST(7 AS REAL) / 2 to get 3.5 everywhere.

O que este quiz cobre

  • Integer division and string concatenation
  • COUNT(*), COUNT(col) and COUNT(DISTINCT col)
  • WHERE vs HAVING, and filters in ON vs WHERE
  • UNION vs UNION ALL, and text compared as text
  • The logical order of SQL clauses

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.