Database - Introduction to SQL - Discussion
Discussion Forum : Introduction to SQL - True or False (Q.No. 19)
19.
SUM, AVG, MIN, and MAX can only be used with numeric columns.
Discussion:
5 comments Page 1 of 1.
Radhika Patel said:
12 months ago
The SQL aggregate functions SUM, AVG, MIN, and MAX are typically used with numeric columns, as they operate on numerical data to compute a sum, average, minimum, or maximum value, respectively. However, MIN and MAX can also be used with non-numeric data, such as strings, where they return the lexicographically smallest or largest value. So, MIN and MAX can not only be used with numeric columns. Therefore the final answer is FALSE.
Adarsh said:
1 decade ago
SUM and AVG can be used only with numeric columns, for example int, small int, tinyint, decimal, numeric, float, real, money, and small money data types. MIN and MAX cannot be used with bit data types.
Pooja said:
1 decade ago
Avg and sum are needed to be numeric. While max, min and count can be non-numeric. i.e. they can be string as well.
Renu Tuli said:
1 decade ago
You can use AVG(), SUM(), MIN(), MAX(), VARIANCE(), STDDEV() functions for numeric data types only. The COUNT() function can be used for any data type.
Srinu said:
1 decade ago
It is not working the sql server. So we can't say true for all. Ther will be the right ans for it is FALSE.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers