MySQL Database Quiz Questions

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

In MySQL, the equality comparison operator is represented by ==.

Q2
True / False

In MySQL, the operator <> can be used to check for inequality.

Q3
True / False

In MySQL, the < operator checks if the value on the left is greater than the value on the right.

Q4
True / False

In MySQL, the comparison operators >= and <= can be used to check for greater than or equal to and less than or equal to, respectively.

Q5
True / False

MySQL does not allow the use of comparison operators in the WHERE clause.

Q6
True / False

The BETWEEN operator in MySQL is used to compare a value against a range of values inclusive of the boundaries.

Q7
True / False

MySQL's comparison operators can only be used with numeric data types.

Q8
True / False

In MySQL, the IN operator can be used to check if a value matches any value in a list of values.

Q9
True / False

In MySQL, the LIKE operator is used for exact match comparisons.

Q10
True / False

In MySQL, the = operator can be used to compare two NULL values and return TRUE if they are both NULL.

Q11
Single Choice

Which MySQL comparison operator checks if two values are not equal?

Q12
Single Choice

What is the output of the following MySQL query?

SQL Code
SELECT * FROM employees WHERE salary > 50000;
Q13
Single Choice

Which operator would you use to check if a value is between two values in MySQL?

Q14
Single Choice

What is the result of this MySQL query?

SQL Code
SELECT * FROM products WHERE price >= 100 AND price <= 500;
Q15
Single Choice

Which MySQL comparison operator would you use to find records where a column is not null?

Q16
Single Choice

How would you write a query to find records where a column value is exactly equal to 10 in MySQL?

SQL Code
SELECT * FROM orders WHERE quantity = 10;
Q17
Single Choice

Consider the following MySQL query. What does it retrieve?

SQL Code
SELECT * FROM employees WHERE (age < 30 OR age > 50) AND status = 'active';
Q18
Single Choice

Which query correctly uses MySQL comparison operators to find records where a column value is not between two specified values?

SQL Code
SELECT * FROM sales WHERE amount NOT BETWEEN 100 AND 500;
Q19
Single Choice

Which of the following SQL statements uses a MySQL comparison operator to find records with a column value either greater than 100 or less than 10?

SQL Code
SELECT * FROM inventory WHERE quantity > 100 OR quantity < 10;
Q20
Single Choice

Given the following MySQL query, what does it return?

SQL Code
SELECT * FROM students WHERE grade >= 90 AND grade <= 100 OR grade < 60;
Q21
Multiple Choice

Which SQL query correctly uses the '=' operator to find all employees with a specific department ID?

SQL Code
SELECT name, department_id
FROM employees
WHERE department_id = 5;
Q22
Multiple Choice

Identify the SQL query that uses the '<>' operator to exclude a specific salary from the results.

SQL Code
SELECT name, salary
FROM employees
WHERE salary <> 50000;
Q23
Multiple Choice

Which SQL query uses the '>' operator to find all products with a price greater than 100?

SQL Code
SELECT product_name, price
FROM products
WHERE price > 100;
Q24
Multiple Choice

Determine the SQL query that uses the '<=' operator to include products with a price less than or equal to 50.

SQL Code
SELECT product_name, price
FROM products
WHERE price <= 50;
Q25
Multiple Choice

Which SQL query correctly uses the '!=' operator to filter out employees from a specific department?

SQL Code
SELECT name, department_id
FROM employees
WHERE department_id != 3;
Q26
Multiple Choice

Which SQL query uses the '=' operator to find orders with a specific order status?

SQL Code
SELECT order_id, status
FROM orders
WHERE status = 'Shipped';
Q27
Multiple Choice

Identify the SQL query that uses the '>' operator to find customers with an account balance greater than zero.

SQL Code
SELECT customer_name, account_balance
FROM customers
WHERE account_balance > 0;
Q28
Multiple Choice

Which SQL query uses the '<' operator to find products with a quantity in stock less than a specified value?

SQL Code
SELECT product_name, quantity_in_stock
FROM inventory
WHERE quantity_in_stock < 10;
Q29
Multiple Choice

Determine the SQL query that uses the '<>' operator to find records where two columns do not have the same value.

SQL Code
SELECT order_id, product_id
FROM order_details
WHERE product_id <> special_offer_id;
Q30
Multiple Choice

Which SQL query uses comparison operators to filter products within a specific price range?

SQL Code
SELECT product_name, price
FROM products
WHERE price >= 50 AND price <= 100;