Question: SQL sublanguage: DQL ( Data Query Language ) * * Aggregate functions in SQL are functions which preform operations on multiple rows to produce a

SQL sublanguage: DQL (Data Query Language)
*
* Aggregate functions in SQL are functions which preform operations on multiple rows to produce a single output.
* For instance, COUNT() is an aggregate function. Count will return the number of rows of data in the result set.
* So if we query a table with 12 rows using a statement like this:
* SELECT COUNT(*) FROM table_name;
* We should get the value 12
*
* Aggregate functions "aggregate" data, combining and changing it into some output based on the input. Regardless of
* how large that input is, the output will always be a single value. If we repeated the above query but the table had
*10,000 rows, the result would still be a single value: 10,000.
*
* There are many aggregate functions built into SQL, some commonly used ones include:
*- SUM()- outputs the sum of the values in a single column from the result set
*- AVG()- outputs the average (mean) value of the values in a single column from the result set
*- MIN()- outputs the least value among the values in a single column from the result set
*- MAX()- similar to MIN but outputs the greatest value
*- FIRST()- outputs the first value found in a column of the result set
*- LAST()- outputs the last value found in a column of the result set
*
* Example: You might use the SUM() function to find the total of all employee salaries:
* SELECT SUM(salary) FROM employee;
*/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!