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.

Mittel 10 Fragen ~6 Minuten Bestanden ab 80% SQLite

Modus wählen

Du spielst als Gast: Melde dich an, damit XP und Serie gespeichert werden.

Beispielfrage

Frage 1 von 10

What does this print in SQLite?

SELECT 7 / 2;
Lösung zeigen

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.

Darum geht es in diesem 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

Häufige Fragen

Brauche ich ein Konto?

Nein. Jeder kann spielen. Mit Anmeldung werden XP, Serie, Abzeichen und Verlauf gespeichert.

Kann ich es wiederholen?

Ja. Dein Bestwert bleibt erhalten, und Fragen und Antworten werden jedes Mal neu gemischt.