SQL Functions
SQL Functions
TOPIC 6 : FUNCTIONS
AGGREGATE FUNCTIONS:
Used to perform calculations on multiple rows of data and return a single
summarized result.
1) Count()
Returns the number of rows that match a given condition
Query:
SELECT COUNT(*) AS TotalRecords FROM Employee;
2) SUM()
Calculates the total sum of a numeric column.
Query:
SELECT SUM(Salary) AS TotalSalary FROM Employee;
3) AVG()
Calculates the average of a numeric column.
Query:
SELECT AVG(Salary) AS AverageSalary FROM Employee;
10) How do you get today's date without the time part
SELECT TRUNC(SYSDATE) AS today_date FROM dual;