Professional Documents
Culture Documents
like,min(salary)...notlike,min(salary,employee_id)
Maximum(Max)
Minimum(MIN)
Average(Avg)
Sum
Count
Maximum(Max)
Syntax :
Max(expression)
FOR EXAMPLE:-
SELECT MAX(SALARY) FROM EMPLOYEES;
MIN FUNCTION:
Query:
Query:
Query:
COUNT() Syntax
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
Query:
Query:
The GROUP BY statement groups rows that have the same values into summary rows, like "find the
number of customers in each country".
GROUP BY Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
QUERY:
--
--WISE KEYWORD USING MULTIROW FUNCTION
E.X:
DEPARTMENT WISE
COUNTRY WISE
CITY WISE
THE ABOVE STATEMENT WAS WRONG BECAUSE OF YOU COULDN’T USE NON-AGGREGATE
FUNCTION IN AGGREGATE FUNCTION
CREATE TABLE F1
SNO NUMBER,
NAME VARCHAR2(25),
TAMIL NUMBER
);
It may be allowed in CREATE VIEW While it does not use in CREATE VIEW
2. statement. statement.
In group by clause, the tuples are grouped Whereas in order by clause, the result-
based on the similarity between the set is sorted based on ascending or
5. attribute values of tuples. descending order.
SR.NO
. WHERE Clause HAVING Clause
1. WHERE Clause is used to filter the records HAVING Clause is used to filter record
from the table based on the specified from the groups based on the specified
SR.NO
. WHERE Clause HAVING Clause
condition. condition.
WHERE Clause can be used without HAVING Clause cannot be used without
2. GROUP BY Clause GROUP BY Clause
WHERE Clause cannot contain aggregate HAVING Clause can contain aggregate
4. function function
WHERE Clause can be used with SELECT, HAVING Clause can only be used with
5. UPDATE, DELETE statement. SELECT statement.
WHERE Clause is used before GROUP BY HAVING Clause is used after GROUP BY
6. Clause Clause
WHERE Clause is used with single row HAVING Clause is used with multiple row
7. function like UPPER, LOWER etc. function like SUM, COUNT etc.
Query:
Query:
Query: