- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
SQL NULL Values Quiz
NULL means "unknown" in SQL, and it behaves differently from any normal value. This quiz tests IS NULL, COALESCE, NULL in arithmetic and the NOT IN trap that silently returns nothing.
Sample question
Question 1 of 10What does this query return?
CREATE TABLE staff (name TEXT, manager TEXT, bonus INTEGER);
INSERT INTO staff VALUES ('Ana', NULL, 100), ('Ben', 'Ana', NULL), ('Cy', 'Ana', 50), ('Dee', NULL, NULL);
SELECT COUNT(*) FROM staff WHERE bonus = NULL;
Show the answer
C. 0 Any comparison with NULL gives NULL (unknown), not true, and WHERE only keeps rows where the condition is true. So = NULL matches nothing; use IS NULL.
What this quiz covers
- Why
= NULLnever matches andIS NULLdoes - NULL in arithmetic and comparisons like
<> - Replacing missing values with
COALESCE - The
NOT INtrap when a list containsNULL - Where
NULLs go when sorting
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.