Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Quiz: Logical and Comparison Operators

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which SQL operator is used to combine two conditions where both must be true?

a)

OR

b)

LIKE

c)

AND

d)

BETWEEN

2.

Which operator returns records that match at least one condition?

a)

AND

b)

NOT

c)

OR

d)

BETWEEN

3.

What does the LIKE operator do in SQL?

a)

Compares numeric values

b)

Searches for a specified pattern in a column

c)

Updates a table record

d)

Filters exact matches only

4.

Which symbol is commonly used with LIKE to represent any number of characters?

a)

#

b)

_

c)

*

d)

%

5.

Which SQL keyword is used to exclude a condition?

a)

OR

b)

NOT

c)

LIKE

d)

AND

6.

Which statement correctly selects values between 10 and 50 inclusive?

a)

WHERE value NOT BETWEEN 10 AND 50

b)

WHERE value BETWEEN 10 AND 50

c)

WHERE value > 10 OR < 50

d)

WHERE value = 10 AND 50

7.

What does NOT LIKE do in a SQL query?

a)

Selects records with similar values

b)

Updates a column value

c)

Excludes records that match a pattern

d)

Sorts data alphabetically

8.

Which query selects values outside the range 100 to 500?

a)

WHERE amount BETWEEN 100 AND 500

b)

WHERE amount NOT BETWEEN 100 AND 500

c)

WHERE amount = 100 OR 500

d)

WHERE amount < 100 AND > 500

9.

Which SQL command is used to modify existing records in a table?

a)

INSERT

b)

DELETE

c)

SELECT

d)

UPDATE

10.

Which statement correctly updates a student's grade to 90 where the ID is 5?

a)

UPDATE students SET grade = 90 WHERE id = 5;

b)

UPDATE grade = 90 FROM students;

c)

SET grade = 90 WHERE id = 5;

d)

MODIFY students grade = 90;