Microsoft SQL Server Database Quiz Questions

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

The BETWEEN operator includes both boundary values in the range.

Q2
True / False

The BETWEEN operator can only be used with numeric values.

Q3
True / False

The query 'SELECT * FROM Products WHERE Price BETWEEN 50 AND 150;' will include products priced at exactly 50 and 150.

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 150;
Q4
True / False

The BETWEEN operator cannot be used with text values.

Q5
True / False

The query 'SELECT * FROM Orders WHERE OrderDate BETWEEN '2023-01-01' AND '2023-06-30';' will include orders placed on '2023-06-30'.

SQL Code
SELECT * FROM Orders
WHERE OrderDate BETWEEN '2023-01-01' AND '2023-06-30';
Q6
True / False

Using the BETWEEN operator with dates requires the dates to be in the format 'YYYY-MM-DD'.

Q7
True / False

The query 'SELECT * FROM Employees WHERE Age BETWEEN 30 AND 40;' will not include employees aged exactly 30 or 40.

SQL Code
SELECT * FROM Employees
WHERE Age BETWEEN 30 AND 40;
Q8
True / False

The BETWEEN operator can be used in conjunction with other operators like AND and OR.

Q9
True / False

Using the BETWEEN operator on a column with NULL values will exclude those rows from the result.

Q10
True / False

The query 'SELECT * FROM Sales WHERE TransactionAmount BETWEEN 1000 AND 5000;' will include transactions of exactly 1000 and 5000.

SQL Code
SELECT * FROM Sales
WHERE TransactionAmount BETWEEN 1000 AND 5000;
Q11
True / False

The BETWEEN operator can be used to filter rows based on a range of character values.

Q12
True / False

In the query 'SELECT * FROM Products WHERE Price BETWEEN 50 AND 150;', the result will exclude prices of 50 and 150.

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 150;
Q13
True / False

The BETWEEN operator cannot be used with columns of type DATETIME.

Q14
True / False

In the query 'SELECT * FROM Employees WHERE HireDate BETWEEN '2022-01-01' AND '2022-12-31';', the result will include employees hired on '2022-12-31'.

SQL Code
SELECT * FROM Employees
WHERE HireDate BETWEEN '2022-01-01' AND '2022-12-31';
Q15
True / False

The BETWEEN operator can be used to filter rows based on a range of numeric values only.

Q16
Single Choice

Which query will correctly retrieve products priced between $50 and $150?

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 150;
Q17
Single Choice

Which of the following is true about the BETWEEN operator?

Q18
Single Choice

What will be the result of the following query? SELECT * FROM Orders WHERE OrderDate BETWEEN '2023-01-01' AND '2023-12-31';

SQL Code
SELECT * FROM Orders
WHERE OrderDate BETWEEN '2023-01-01' AND '2023-12-31';
Q19
Single Choice

How does the BETWEEN operator handle NULL values?

Q20
Single Choice

Which query will retrieve employees hired between '2022-01-01' and '2022-12-31' inclusive?

SQL Code
SELECT * FROM Employees
WHERE HireDate BETWEEN '2022-01-01' AND '2022-12-31';
Q21
Single Choice

In the query 'SELECT * FROM Products WHERE Price BETWEEN 100 AND 200;', which prices are included?

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 100 AND 200;
Q22
Single Choice

Which query will correctly retrieve records for dates between '2021-01-01' and '2021-12-31'?

SQL Code
SELECT * FROM Records
WHERE RecordDate BETWEEN '2021-01-01' AND '2021-12-31';
Q23
Single Choice

How can you modify the query 'SELECT * FROM Sales WHERE Amount BETWEEN 1000 AND 5000;' to exclude the boundary values?

SQL Code
SELECT * FROM Sales
WHERE Amount BETWEEN 1000 AND 5000;
Q24
Single Choice

Which of the following queries will include dates '2023-01-01' and '2023-12-31'?

SQL Code
SELECT * FROM Events
WHERE EventDate BETWEEN '2023-01-01' AND '2023-12-31';
Q25
Single Choice

What will be the result of the query 'SELECT * FROM Inventory WHERE Quantity BETWEEN 10 AND 20;'?

SQL Code
SELECT * FROM Inventory
WHERE Quantity BETWEEN 10 AND 20;
Q26
Single Choice

How does the BETWEEN operator treat date ranges?

Q27
Single Choice

Which query will retrieve employees aged between 25 and 30 inclusive?

SQL Code
SELECT * FROM Employees
WHERE Age BETWEEN 25 AND 30;
Q28
Single Choice

Which query will correctly filter products with prices between $100 and $500?

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 100 AND 500;
Q29
Single Choice

Which query will retrieve orders placed between '2022-01-01' and '2022-12-31'?

SQL Code
SELECT * FROM Orders
WHERE OrderDate BETWEEN '2022-01-01' AND '2022-12-31';
Q30
Single Choice

How can you modify the query 'SELECT * FROM Events WHERE EventDate BETWEEN '2023-01-01' AND '2023-12-31';' to exclude the boundary dates?

SQL Code
SELECT * FROM Events
WHERE EventDate BETWEEN '2023-01-01' AND '2023-12-31';
Q31
Multiple Choice

Which of the following queries will correctly retrieve records for dates between '2021-01-01' and '2021-12-31'?

SQL Code
SELECT * FROM Records
WHERE RecordDate BETWEEN '2021-01-01' AND '2021-12-31';
Q32
Multiple Choice

Which queries will retrieve products priced between $100 and $200?

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 100 AND 200;
Q33
Multiple Choice

Which of the following queries correctly use the BETWEEN operator with dates?

SQL Code
SELECT * FROM Events
WHERE EventDate BETWEEN '2023-01-01' AND '2023-12-31';
Q34
Multiple Choice

Which queries will include prices of 50 and 150?

SQL Code
SELECT * FROM Products
WHERE Price BETWEEN 50 AND 150;
Q35
Multiple Choice

Which queries will retrieve employees aged between 25 and 35 inclusive?

SQL Code
SELECT * FROM Employees
WHERE Age BETWEEN 25 AND 35;
Q36
Multiple Choice

Which of the following queries will correctly retrieve records for a range of character values?

SQL Code
SELECT * FROM Records
WHERE RecordName BETWEEN 'A' AND 'M';
Q37
Multiple Choice

Which queries correctly use the BETWEEN operator with date and time values?

SQL Code
SELECT * FROM Events
WHERE EventDateTime BETWEEN '2023-01-01 00:00:00' AND '2023-12-31 23:59:59';
Q38
Multiple Choice

Which of the following queries will retrieve products with IDs between 1 and 100 inclusive?

SQL Code
SELECT * FROM Products
WHERE ProductID BETWEEN 1 AND 100;
Q39
Multiple Choice

Which queries will correctly retrieve sales amounts between 500 and 1000?

SQL Code
SELECT * FROM Sales
WHERE Amount BETWEEN 500 AND 1000;
Q40
Multiple Choice

Which of the following queries will retrieve students with scores between 80 and 90?

SQL Code
SELECT * FROM Students
WHERE Score BETWEEN 80 AND 90;
Q41
Multiple Choice

Which of the following queries will correctly filter records with date ranges?

SQL Code
SELECT * FROM Records
WHERE RecordDate BETWEEN '2022-01-01' AND '2022-12-31';
Q42
Multiple Choice

Which queries will correctly retrieve customers aged between 18 and 25 inclusive?

SQL Code
SELECT * FROM Customers
WHERE Age BETWEEN 18 AND 25;
Q43
Multiple Choice

Which queries will retrieve orders placed between '2023-01-01' and '2023-12-31'?

SQL Code
SELECT * FROM Orders
WHERE OrderDate BETWEEN '2023-01-01' AND '2023-12-31';
Q44
Multiple Choice

Which of the following queries will correctly retrieve product IDs between 100 and 200 inclusive?

SQL Code
SELECT * FROM Products
WHERE ProductID BETWEEN 100 AND 200;
Q45
Multiple Choice

Which of the following queries will include scores between 70 and 85 inclusive?

SQL Code
SELECT * FROM Scores
WHERE Score BETWEEN 70 AND 85;