MySQL Database Quiz Questions

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

The BETWEEN operator in MySQL is used to filter the result set within a certain range.

Q2
True / False

MySQL's BETWEEN operator includes the endpoints of the specified range.

Q3
True / False

In MySQL, the BETWEEN operator can only be used with numerical data types.

Q4
True / False

The BETWEEN operator in MySQL can be used with the NOT keyword to exclude a range of values.

Q5
True / False

The MySQL BETWEEN operator can be used with SQL aliases for column names.

Q6
True / False

When using the BETWEEN operator in MySQL with dates, the format must be 'YYYY-MM-DD'.

Q7
True / False

In MySQL, the BETWEEN operator can be used in a WHERE clause but not in a HAVING clause.

Q8
True / False

MySQL's BETWEEN operator can compare values in different columns of the same table.

Q9
True / False

In MySQL, using the BETWEEN operator with text values is case-sensitive.

Q10
True / False

The MySQL BETWEEN operator is optimized for performance, making it preferable for large data ranges over multiple OR conditions.

Q11
Single Choice

Which of the following MySQL queries correctly uses the BETWEEN operator to filter results within a specified range?

SQL Code
SELECT * FROM employees WHERE salary BETWEEN 30000 AND 50000;
Q12
Single Choice

What does the BETWEEN operator return when the lower bound is greater than the upper bound?

Q13
Single Choice

In MySQL, what is the default behavior of the BETWEEN operator regarding inclusivity?

Q14
Single Choice

Given the following MySQL query, how many rows will be returned?

SQL Code
SELECT * FROM orders WHERE order_date BETWEEN '2023-01-01' AND '2023-12-31';
Q15
Single Choice

Which of the following MySQL queries will correctly find products with prices between $10 and $20, inclusive?

SQL Code
SELECT product_name FROM products WHERE price BETWEEN 10 AND 20;
Q16
Single Choice

What will be the result of the following MySQL query if the employee_id column has values ranging from 1 to 100?

SQL Code
SELECT * FROM employees WHERE employee_id BETWEEN 90 AND 110;
Q17
Single Choice

In the context of a MySQL query, how can the BETWEEN operator be used with non-numeric columns?

SQL Code
SELECT * FROM employees WHERE last_name BETWEEN 'A' AND 'M';
Q18
Single Choice

What is the effect of using NOT BETWEEN in a MySQL query?

SQL Code
SELECT * FROM sales WHERE quantity NOT BETWEEN 50 AND 100;
Q19
Single Choice

What will be the result of the following MySQL query when applied to a table where the rating column contains NULL values?

SQL Code
SELECT * FROM movies WHERE rating BETWEEN 7 AND 9;
Q20
Single Choice

Which MySQL query using the BETWEEN operator will correctly filter out products whose names are alphabetically between 'Car' and 'Hat', assuming there are no product names with those exact values?

SQL Code
SELECT product_name FROM products WHERE product_name BETWEEN 'Car' AND 'Hat';
Q21
Multiple Choice

Which query correctly retrieves records from the 'employees' table where the 'age' is between 25 and 35?

SQL Code
SELECT *
FROM employees
WHERE age BETWEEN 25 AND 35;
Q22
Multiple Choice

Identify the correct SQL query that selects records from the 'orders' table where 'order_date' is between '2023-01-01' and '2023-12-31'.

SQL Code
SELECT *
FROM orders
WHERE order_date BETWEEN '2023-01-01' AND '2023-12-31';
Q23
Multiple Choice

Determine the correct SQL query to retrieve records from the 'products' table where the 'price' is between 50 and 100.

SQL Code
SELECT *
FROM products
WHERE price BETWEEN 50 AND 100;
Q24
Multiple Choice

Which SQL query retrieves records from the 'customers' table where 'credit_limit' is between 1000 and 5000?

SQL Code
SELECT *
FROM customers
WHERE credit_limit BETWEEN 1000 AND 5000;
Q25
Multiple Choice

Identify the correct query that selects records from the 'inventory' table where the 'quantity' is between 10 and 100.

SQL Code
SELECT *
FROM inventory
WHERE quantity BETWEEN 10 AND 100;
Q26
Multiple Choice

Which SQL query correctly selects records from the 'sales' table where 'total_amount' is between 500 and 1000?

SQL Code
SELECT *
FROM sales
WHERE total_amount BETWEEN 500 AND 1000;
Q27
Multiple Choice

Determine the correct query to retrieve records from the 'transactions' table where the 'transaction_date' is between '2024-01-01' and '2024-06-30'.

SQL Code
SELECT *
FROM transactions
WHERE transaction_date BETWEEN '2024-01-01' AND '2024-06-30';
Q28
Multiple Choice

Which SQL query retrieves records from the 'employees' table where 'hire_date' is between '2020-01-01' and '2020-12-31'?

SQL Code
SELECT *
FROM employees
WHERE hire_date BETWEEN '2020-01-01' AND '2020-12-31';
Q29
Multiple Choice

Which query correctly retrieves records from the 'inventory' table where the 'restock_date' is between '2024-07-01' and '2024-12-31'?

SQL Code
SELECT *
FROM inventory
WHERE restock_date BETWEEN '2024-07-01' AND '2024-12-31';
Q30
Multiple Choice

Identify the correct SQL query that retrieves records from the 'projects' table where 'budget' is between 50000 and 200000.

SQL Code
SELECT *
FROM projects
WHERE budget BETWEEN 50000 AND 200000;