wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SQL Command Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which SQL command is used to fetch data from a table?

a)

GET

b)

FETCH

c)

SELECT

d)

READ

2.

Which clause is used to filter rows before grouping?

a)

HAVING

b)

WHERE

c)

ORDER BY

d)

GROUP BY

3.

Which aggregate function returns the total number of rows?

a)

SUM()

b)

COUNT()

c)

AVG()

d)

COUNT(*)

4.

What does AVG() return?

a)

Highest value

b)

Lowest value

c)

Average value

d)

Total count

5.

Which clause is mandatory when using aggregate functions with non-aggregated columns?

a)

WHERE

b)

ORDER BY

c)

GROUP BY

d)

HAVING

6.

Which function returns the highest value in a column?

a)

TOP()

b)

HIGH()

c)

MAX()

d)

LARGE()

7.

Which clause is used to filter grouped data?

a)

WHERE

b)

HAVING

c)

GROUP BY

d)

ORDER BY

8.

Which JOIN returns only matching rows from both tables?

a)

LEFT JOIN

b)

RIGHT JOIN

c)

FULL JOIN

d)

INNER JOIN

9.

Which JOIN returns all rows from the left table and matching rows from the right table?

a)

INNER JOIN

b)

LEFT JOIN

c)

RIGHT JOIN

d)

FULL JOIN

10.

Which JOIN returns all rows from both tables including unmatched rows?

a)

INNER JOIN

b)

LEFT JOIN

c)

RIGHT JOIN

d)

FULL OUTER JOIN

11.

What happens if COUNT(column_name) is used?

a)

Counts all rows

b)

Counts only non-NULL values

c)

Counts duplicate values

d)

Counts columns

12.

Which keyword is used to sort query results?

a)

SORT

b)

FILTER

c)

ORDER BY

d)

GROUP BY

13.

Which JOIN is used when matching data from the same table?

a)

INNER JOIN

b)

LEFT JOIN

c)

SELF JOIN

d)

FULL JOIN

14.

Which aggregate function returns the smallest value?

a)

MIN()

b)

LOW()

c)

SMALL()

d)

MIN()

15.

Which of the following is NOT an aggregate function?

a)

SUM()

b)

COUNT()

c)

AVG()

d)

ORDER BY