MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:IS NULL Operator
Current Quiz Count:30
Progress
0%
Q1
True / False

In MySQL, the IS NULL condition can be used to check if a column's value is NULL.

Q2
True / False

In MySQL, IS NULL is used to replace NULL values with a specified value.

Q3
True / False

In MySQL, the expression NULL IS NULL evaluates to True.

Q4
True / False

In MySQL, you can use the IS NULL condition in a WHERE clause to filter out rows with NULL values.

Q5
True / False

In MySQL, IS NULL can be used with any data type, including text, date, and numeric.

Q6
True / False

In MySQL, using IS NULL in a query will significantly slow down the query performance.

Q7
True / False

In MySQL, you cannot use IS NULL in combination with GROUP BY and HAVING clauses.

Q8
True / False

In MySQL, the IS NULL condition can be combined with the CASE statement to perform conditional logic based on NULL values.

Q9
True / False

In MySQL, you can use an index on a column to improve the performance of queries using IS NULL.

Q10
True / False

In MySQL, the IS NULL condition can be used in a JOIN clause to retrieve rows with NULL values in the join condition.

Q11
Single Choice

Which of the following MySQL conditions will correctly check if the name column is empty?

Q12
Single Choice

What does this query do?

SQL Code
Consider the following SQL query:
SELECT * FROM employees WHERE department_id IS NULL;
Q13
Single Choice

Which of the following statements is correct regarding the MySQL IS NULL operator?

Q14
Single Choice

Given the table orders with columns order_id, customer_id, and delivery_date, what does the following query return?

SQL Code
SELECT order_id FROM orders WHERE delivery_date IS NULL;
Q15
Single Choice

What is the result of the following query if the salary column contains the values NULL, 50000, and 70000?

Q16
Single Choice

In MySQL, how can you select all records from the students table where the graduation_year column has no value assigned?

Q17
Single Choice

What will the query return if department_name is NULL?

SQL Code
Given the following SQL statement:
SELECT COALESCE(department_name, 'Unknown') FROM departments;
Q18
Single Choice

Which of the following queries will correctly select products that have no price listed?

SQL Code
Consider the following products table:
product_id | product_name | price
-----------|--------------|-------
1 | Phone | 500
2 | Laptop | NULL
3 | Tablet | 300
Q19
Single Choice

How does MySQL treat NULL values when using the GROUP BY clause in the following query?

SQL Code
SELECT department_id, COUNT(*) FROM employees GROUP BY department_id;
Q20
Single Choice

What will the following MySQL query return when run on a table inventory where some product_name entries are NULL

SQL Code
SELECT IF(product_name IS NULL, 'No Name', product_name) AS product_name FROM inventory;
Q21
Multiple Choice

Which query correctly retrieves records from the 'employees' table where the 'manager_id' is NULL?

SQL Code
SELECT *
FROM employees
WHERE manager_id IS NULL;
Q22
Multiple Choice

Identify the correct SQL query that retrieves records from the 'orders' table where the 'shipped_date' is NULL.

SQL Code
SELECT *
FROM orders
WHERE shipped_date IS NULL;
Q23
Multiple Choice

Which query correctly selects records from the 'products' table where the 'discount' column is NULL?

SQL Code
SELECT *
FROM products
WHERE discount IS NULL;
Q24
Multiple Choice

Determine the correct SQL query that retrieves records from the 'customers' table where the 'phone_number' is NULL.

SQL Code
SELECT *
FROM customers
WHERE phone_number IS NULL;
Q25
Multiple Choice

Which SQL query retrieves records from the 'inventory' table where the 'last_restocked' date is NULL?

SQL Code
SELECT *
FROM inventory
WHERE last_restocked IS NULL;
Q26
Multiple Choice

Which query correctly retrieves records from the 'employees' table where the 'termination_date' is NULL?

SQL Code
SELECT *
FROM employees
WHERE termination_date IS NULL;
Q27
Multiple Choice

Determine the correct SQL query that selects records from the 'payments' table where the 'transaction_id' is NULL.

SQL Code
SELECT *
FROM payments
WHERE transaction_id IS NULL;
Q28
Multiple Choice

Which SQL query retrieves records from the 'clients' table where the 'email' field is NULL?

SQL Code
SELECT *
FROM clients
WHERE email IS NULL;
Q29
Multiple Choice

Identify the correct query that retrieves records from the 'contracts' table where the 'end_date' is NULL.

SQL Code
SELECT *
FROM contracts
WHERE end_date IS NULL;
Q30
Multiple Choice

Which SQL query correctly retrieves records from the 'students' table where the 'graduation_date' is NULL?

SQL Code
SELECT *
FROM students
WHERE graduation_date IS NULL;