What does NULL represent in MySQL?
A
A value of 0 B
An empty string C
An unknown or missing value D
A default value
Analysis & Theory
NULL represents an unknown, missing, or undefined value—not zero or an empty string.
Which of the following is true about NULL in MySQL?
A
NULL is equal to 0 B
NULL is equal to an empty string C
NULL is not equal to any value, even another NULL D
NULL is the smallest number
Analysis & Theory
NULL is not equal to anything—not even to another NULL value.
Which operator is used to check for NULL in MySQL?
A
= B
== C
IS NULL D
!= NULL
Analysis & Theory
You must use `IS NULL` to test if a column contains a NULL value.
What will `SELECT * FROM users WHERE age = NULL;` return?
A
All users with NULL age B
No rows C
All users D
Users with age 0
Analysis & Theory
Using `= NULL` is incorrect. You must use `IS NULL` to check for NULL values.
How do you check if a column is NOT NULL?
A
WHERE column = NOT NULL B
WHERE column <> NULL C
WHERE column IS NOT NULL D
WHERE column != NULL
Analysis & Theory
The correct syntax to check for non-NULL values is `IS NOT NULL`.
What will happen if you try to insert NULL into a column defined as NOT NULL?
A
NULL is inserted B
Column becomes empty C
An error is raised D
The value is set to 0
Analysis & Theory
Inserting NULL into a NOT NULL column will result in an error.
Which aggregate function ignores NULL values in MySQL?
A
COUNT(*) B
COUNT(column) C
SUM(column) D
All of the above
Analysis & Theory
Aggregate functions like COUNT(column), SUM, AVG, etc. ignore NULLs. COUNT(*) counts all rows including NULLs.
What does the `IFNULL()` function do in MySQL?
A
Replaces 0 with NULL B
Compares two NULL values C
Returns the second argument if the first is NULL D
Deletes NULL values
Analysis & Theory
`IFNULL(expr1, expr2)` returns expr2 if expr1 is NULL; otherwise, it returns expr1.
Which function can you use to replace NULL with a custom value in a SELECT result?
A
ISNULL() B
NULLIF() C
IF() D
COALESCE()
Analysis & Theory
`COALESCE()` returns the first non-NULL value in a list of arguments.
What is the result of `NULL + 100` in MySQL?
A
100 B
NULL C
0 D
An error
Analysis & Theory
Any arithmetic operation involving NULL results in NULL.