- Ausführende
-
Lernen
Python lernen Ausführbare Beispiele, NumPy, pandas und mehr KI / Machine Learning lernenNeuronale Netze, ML und LLMs von Grund auf C/C++ lernen Zeiger, Speicher, STL und modernes C++ C# lernenC#-Grundlagen, OOP, LINQ, Async und .NET-Übungen Matplotlib lernenLinien-, Balken-, Streu- und Kreisdiagramme mit interaktiven Visualisierungen Rust lernenOwnership, Traits, Fehlerbehandlung und Threads Go lernenSlices, Interfaces, Goroutinen und Channels Python-Algorithmen Suche, Sortierung, Rekursion und Visualisierungen O(n) C/C++-Algorithmen Implementierungen in C und C++ vergleichen Programmieren für Kinder Spielend programmieren lernen!
- QuizzeNeu
- AufgabenNeu
- Für LehrkräfteNeu
- Aktualisierungen
- Spendier mir einen Kaffee
SQL: Find the Bug
This SQL quiz shows queries with a comment saying what they were meant to do, and asks what they really return or what is wrong. The bugs are the ones that slip into real code and interviews, like operator precedence, join fan-out, integer division and subqueries that quietly match everything.
Beispielfrage
Frage 1 von 10The query below has a bug. What does it print?
CREATE TABLE products (name TEXT, category TEXT, price INTEGER);
INSERT INTO products VALUES
('pen', 'office', 2), ('desk', 'office', 300),
('tv', 'tech', 500), ('cable', 'tech', 5);
-- meant: cheap items (price < 10) in office or tech
SELECT COUNT(*) FROM products
WHERE category = 'office' OR category = 'tech' AND price < 10;
Lösung zeigen
B. 3 AND binds tighter than OR, so this means office OR (tech AND price < 10): pen, desk and cable. Add parentheses, (category = 'office' OR category = 'tech') AND price < 10, or use category IN ('office', 'tech'), to get the intended 2.
Darum geht es in diesem Quiz
- AND/OR precedence and date range edges
COUNT(*)withLEFT JOIN, and join fan-out inSUM- Integer division in percentages
- Ambiguous columns,
UNIONmismatches and quoting - Subqueries and window functions used in the wrong place
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.