MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The AVG SQL function returns the ____
A
the sum of values in a column
B
average in the values in agroup.
C
maximum value from a column.
D
None of the above
Explanation: 

Detailed explanation-1: -SQL Server AVG() function is an aggregate function that returns the average value of a group. In this syntax: ALL instructs the AVG() function to take all values for calculation. ALL is used by default.

Detailed explanation-2: -The AVG() function returns the average value of a numeric column.

Detailed explanation-3: -The AVG function returns the average (arithmetic mean) of the input expression values. The AVG function works with numeric values and ignores NULL values.

Detailed explanation-4: -The SQL AVG() function is used to find the average of values over records from a table. To understand this with an example, consider the following table that contains employee records.

Detailed explanation-5: -SQL AVG function is used to find out the average of a field in various records. You can take average of various records set using GROUP BY clause. Following example will take average all the records related to a single person and you will have average typed pages by every person.

There is 1 question to complete.