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.

Medio 10 domande ~6 minuti Superato con il 80% SQLite

Scegli una modalità

Stai giocando come ospite: accedi per salvare XP e serie.

Domanda di esempio

Domanda 1 di 10

What does this print in SQLite?

SELECT 7 / 2;
Mostra la risposta

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.

Cosa copre questo quiz

  • 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

Domande frequenti

Serve un account?

No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.

Posso rifarlo?

Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.