What does the MIN() function do?
A
Returns the smallest value in a column B
Returns the largest value in a column C
Returns the sum of all values D
Counts the number of rows
Analysis & Theory
MIN() returns the minimum value from the specified column.
What does the MAX() function do?
A
Returns the smallest value B
Returns the average value C
Returns the largest value D
Returns the total number of rows
Analysis & Theory
MAX() returns the maximum value in a column.
Which of the following queries gets the highest salary from the employees table?
A
SELECT MAX(salary) FROM employees; B
SELECT MIN(salary) FROM employees; C
SELECT SUM(salary) FROM employees; D
SELECT TOP salary FROM employees;
Analysis & Theory
MAX() returns the highest value in the salary column.
Which function would you use to find the earliest date in a date column?
A
MAX() B
MIN() C
EARLIEST() D
FIRST()
Analysis & Theory
MIN() returns the earliest (smallest) date.
What does this query return?
SELECT MIN(price) FROM products;
A
The highest price B
The lowest price C
The total of all prices D
The count of prices
Analysis & Theory
MIN(price) returns the smallest price.
If a column contains NULL values, what does MIN() do?
A
Counts the NULLs B
Ignores NULLs C
Returns NULL D
Causes an error
Analysis & Theory
MIN() and MAX() ignore NULL values.
Which query returns both the lowest and highest salaries?
A
SELECT MIN(salary), MAX(salary) FROM employees; B
SELECT MIN_MAX(salary) FROM employees; C
SELECT MIN AND MAX salary FROM employees; D
SELECT RANGE(salary) FROM employees;
Analysis & Theory
You can use both functions in the same SELECT statement.
Which clause can you combine with MAX() to find the maximum value per group?
A
ORDER BY B
HAVING C
GROUP BY D
LIMIT
Analysis & Theory
GROUP BY groups rows so MAX() can be applied per group.
What does this query return?
SELECT MAX(join_date) FROM employees;
A
Earliest joining date B
Latest joining date C
Number of employees D
Average joining date
Analysis & Theory
MAX(join_date) returns the most recent date.
Which of these statements is true about MAX() and MIN()?
A
They can only be used with numeric columns B
They ignore NULL values C
They return all rows with max and min values D
They always return text results
Analysis & Theory
They skip NULLs and can be used with numeric, date, and text columns.