MySQL Database Quiz Questions

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

In MySQL, the IS NOT NULL condition can be used to check if a column contains any value other than NULL.

Q2
True / False

Using IS NOT NULL in MySQL will return rows where the specified column has a NULL value.

Q3
True / False

In MySQL, SELECT * FROM table_name WHERE column_name IS NOT NULL will select only the rows where column_name is not NULL.

Q4
True / False

In MySQL, using IS NOT NULL on a column with an index improves query performance.

Q5
True / False

MySQL allows the use of IS NOT NULL within the WHERE clause but not within the HAVING clause.

Q6
True / False

In MySQL, the IS NOT NULL condition cannot be used with aggregate functions like COUNT().

Q7
True / False

MySQL's IS NOT NULL condition can be used in subqueries to filter rows in the main query.

Q8
True / False

In MySQL, using IS NOT NULL in a join condition is not allowed.

Q9
True / False

MySQL automatically converts IS NOT NULL conditions to optimized internal code to improve performance.

Q10
True / False

In MySQL, the IS NOT NULL condition can be used to filter rows in both SELECT and UPDATE statements.

Q11
Single Choice

Which of the following queries will return rows where the email column is not NULL?

SQL Code
SELECT * FROM users WHERE email IS NOT NULL;
Q12
Single Choice

Given the table employees, which query retrieves rows where the salary column has a value?

SQL Code
SELECT * FROM employees WHERE salary IS NOT NULL;
Q13
Single Choice

Which of the following is a correct use of the IS NOT NULL operator?

SQL Code
SELECT * FROM orders WHERE order_date IS NOT NULL;
Q14
Single Choice

What will be the result of the following query?

SQL Code
SELECT COUNT(*) FROM customers WHERE phone IS NOT NULL;
Q15
Single Choice

Which of the following queries correctly filters out rows where address is NULL?

SQL Code
SELECT * FROM users WHERE address IS NOT NULL;
Q16
Single Choice

Which query will select records where the email field is not NULL and starts with 'a'?

SQL Code
SELECT * FROM contacts WHERE email IS NOT NULL AND email LIKE 'a%';
Q17
Single Choice

Consider a table sales with columns id, product_id, quantity, and discount. Which query returns all rows where discount is applied?

SQL Code
SELECT * FROM sales WHERE discount IS NOT NULL;
Q18
Single Choice

What does the following SQL query return?

SQL Code
SELECT product_name FROM products WHERE stock_quantity IS NOT NULL AND price IS NOT NULL;
Q19
Single Choice

Given the following query, what will it return?

SQL Code
SELECT order_id FROM orders WHERE delivery_date IS NOT NULL AND delivery_date < NOW();
Q20
Single Choice

Which of the following statements correctly identifies records where last_login is not NULL and happened within the last 30 days?

SQL Code
SELECT user_id FROM user_log WHERE last_login IS NOT NULL AND last_login >= DATE_SUB(NOW(), INTERVAL 30 DAY);
Q21
Multiple Choice

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

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

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

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

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

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

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

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

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

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

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

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

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

Q28
Multiple Choice

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

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

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

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

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

SQL Code
SELECT *
FROM students
WHERE graduation_date IS NOT NULL;