wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Aggregation, Date & Time Functions Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.
What does the SUM() function do in SQL?
a)
Counts records
b)
Adds numeric values
c)
Finds max value
d)
Filters results
2.
The GROUP BY clause allows SQL to apply aggregate functions to subgroups of data.
a)
True
b)
False
3.

Which clause filters results before aggregation?

(a)  

4.
Which clause filters results after grouping in SQL?
a)
WHERE
b)
GROUP BY
c)
SELECT
d)
HAVING
5.
What does the COUNT(*) function return?
a)
The number of rows
b)
The number of columns
c)
The number of tables
d)
The total spend
6.
Which function would you use to find the highest value in a column?
a)
MIN()
b)
COUNT()
c)
MAX()
d)
TOP()
7.

What SQL clause is used to group multiple columns?

(a)  

8.
Which of the following are valid aggregate functions in SQL?
a)
COUNT()
b)
SUM()
c)
FILTER()
d)
AVG()
9.
Which of the following functions is used to round decimal values?
a)
ROUND()
b)
FLOOR()
c)
TRUNCATE()
d)
DIVIDE()
10.
You can use an aggregate function in the WHERE clause.
a)
True
b)
False
11.
What does the DATE_DIFF() function return?
a)
A timestamp
b)
A date string
c)
The difference between two dates
d)
A list of dates
12.
What is a risk of not using clear naming conventions in SQL code?
a)
Slower queries
b)
Syntax errors
c)
Hard-to-maintain code
d)
More data scanned
13.
Which of the following is a code best practice?
a)
Use short variable names
b)
Avoid comments
c)
Use consistent indentation
d)
Always write in lowercase
14.
Why do we recommend you capitalize SQL keywords in your queries?
a)
Required by SQL
b)
Prevents bugs
c)
Enhances readability
d)
Saves memory
15.

Name one online resource mentioned for solving coding issues

(a)