agg fun.ppt - SQL BASIC OPERATIONS AGGREGATE FUNCTIONS \u2022 What is an aggregate function An aggregate function summarizes the results of an expression

agg fun.ppt - SQL BASIC OPERATIONS AGGREGATE FUNCTIONS...

This preview shows page 1 - 9 out of 40 pages.

SQL BASIC OPERATIONS
Image of page 1
AGGREGATE FUNCTIONS What is an aggregate function?
Image of page 2
AGGREGATE FUNCTIONS Calculate on a set of values & returns a single values It is used with the group by clause of the select statement.
Image of page 3
Commonly used Aggregate functions Some of the commonly used aggregate functions are : SUM COUNT AVG MIN MAX
Image of page 4
EMPLOYEE EID ENAME CITY AGE SALARY 1 ABC PTK 21 10000 2 DEF JAL 22 20000 3 GHI LDH 23 30000 4 JKL GSP 24 40000 5 MNO MPT 25 50000 6 PQR ASR 26 60000
Image of page 5
SUM Select sum<column name> from <table name>; E.g:Select Sum (Salary) from employee; E.g:Select Sum(salary) from employee where name=‘JKL’;
Image of page 6
COUNT() It returns a total no. of values in a given column Syntax:Select count<column name> from<tablename>; E.g:Select count(Empid) from employee;
Image of page 7
COUNT(*) It returns the no.of rows in a table.
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 40 pages?

  • Fall '19
  • Delhi, Articles with example SQL code, Aggregate function, Query optimizer

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture