43.5k views
3 votes
In an SQL query, which built-in function is used to compute the average value of numeric columns?

a) AVG
b) MEAN
c) MAX
d) MIN
e) SUM

1 Answer

1 vote

Final answer:

The SQL function to compute the average value of numeric columns is AVG. This function calculates the mean, and the choice of the measure of center (mean, median, mode) depends on the data's distribution.

Step-by-step explanation:

In an SQL query, the built-in function used to compute the average value of numeric columns is AVG. This function calculates the mean of a set of values by adding them all up and dividing by the count of values. For example, if we have a table called Salaries with a column AnnualSalary, we could use SELECT AVG(AnnualSalary) FROM Salaries to find the average annual salary. When analyzing the shape of the data, functions such as MAX or MIN may provide insights into the range of data, but they do not offer information about the central tendency. Choosing the most appropriate measure of center — mean, median, or mode — will depend on the distribution of the data. For a normally distributed data set, the mean is typically the preferred measure, but for a skewed distribution, the median might be more appropriate.

User Ejaz Karim
by
9.2k points