SQL Database Null and Type Essentials Quiz
A 40-question quiz exploring how NULL behaves, how data types work, conversions, comparisons, and common pitfalls.
Question 1
When reviewing a column storing optional notes from users, you notice some rows contain no value at all. What concept represents this intentional 'no value'?
Question 2
A team is checking incomplete records. They want to find entries where a phone number hasn’t been provided yet. Which comparison style should they rely on?
Question 3
While designing a table, you want a column that always contains a number. Which type best fits this requirement?
Question 4
A developer compares a column to NULL using =. The condition never seems to match. What explains this?
Question 5
When storing product names, which data type generally fits best?
Question 6
A user accidentally leaves a comment field blank. Which value reflects the difference between a blank string and a true NULL?
Question 7
You want to record the date of a transaction. Which data type is designed for this purpose?
Question 8
While analyzing customer records, you notice comparisons involving NULL return unexpected results. Which logical concept explains this?
Question 9
Which statement correctly describes how numeric types behave?
Question 10
A developer needs to store a true/false flag for whether a feature is enabled. Which type is suited for this binary choice?
Question 11
When checking missing payment dates, why isn’t = NULL a valid condition?
Question 12
A column holding temperature as decimal readings accidentally stores some text strings. What issue does this cause?
Question 13
If a field must always contain a date, which constraint prevents NULL from being stored?
Question 14
When storing price values, which type avoids storing unnecessary decimal precision?
Question 15
Why might a birthdate column allow NULL by design?
Question 16
Which statement is true about empty strings?
Question 17
Why should dates be stored in proper DATE types instead of text?
Question 18
A NULL combined with arithmetic, such as price + NULL, results in:
Question 19
Which type is most appropriate for storing a yes/no preference?
Question 20
In a report, comparing city = NULL returns no matches. What's the proper reasoning?
Question 21
A column storing ratings from 1–5 should use which type?
Question 22
A NULL inside a comparison like amount > NULL returns:
Question 23
Which type stores decimal values with precise formatting, often needed in monetary applications?
Question 24
NULL is often used because:
Question 25
A customer record contains an optional middle name. Which condition retrieves rows where no middle name is stored?
SELECT * FROM customers WHERE middle_name IS NULL;Question 26
You want to list items that have an unspecified expiration date. What does this query find?
SELECT id FROM items WHERE expires_at IS NULL;Question 27
A user’s age may be missing. What rows match this query?
SELECT * FROM users WHERE age IS NOT NULL;Question 28
What type of values does this query retrieve?
SELECT score FROM results WHERE score > 50;Question 29
A table tracks timestamps when tasks finish. What result does this query produce?
SELECT id FROM tasks WHERE finished_at IS NOT NULL;Question 30
Consider this age filter. Which values qualify?
SELECT * FROM people WHERE age >= 18;Question 31
A department table stores optional manager IDs. What does this query return?
SELECT name FROM departments WHERE manager_id IS NULL;Question 32
This query checks product weights. What rows are returned?
SELECT * FROM products WHERE weight IS NULL;Question 33
What does this query filter out?
SELECT name FROM pets WHERE height IS NOT NULL;Question 34
Which values survive this filter?
SELECT salary FROM staff WHERE salary < 50000;Question 35
What rows match the following?
SELECT * FROM logs WHERE message IS NULL;Question 36
A movie record may lack a release year. Which rows appear here?
SELECT title FROM movies WHERE release_year IS NULL;Question 37
Which rows qualify under this numeric test?
SELECT score FROM exams WHERE score BETWEEN 60 AND 100;Question 38
What does this condition identify?
SELECT * FROM orders WHERE delivered_at IS NOT NULL;Question 39
Which rows match this comparison?
SELECT id FROM assets WHERE value > 0;Question 40
What group of rows does this query retrieve?
SELECT * FROM profiles WHERE bio IS NULL;