Thursday, May 14, 2020

8 පාඩම - සංඛ්‍යා ගණනය කිරීම සදහා භාවිතා කරන ශ්‍රිත (AGRIGATE FUNCTION)


MIN() Syntax
SELECT MIN(column_name)
FROM table_name
WHERE condition;

MAX() Syntax

SELECT MAX(column_name)
FROM table_name
WHERE condition;

Example-

SELECT MIN(Price) AS SmallestPrice
FROM Products;
SELECT MAX(Price) AS LargestPrice
FROM Products;

COUNT() Syntax

SELECT COUNT(column_name)
FROM table_name
WHERE condition;

AVG() Syntax

SELECT AVG(column_name)
FROM table_name
WHERE condition;

SUM() Syntax

SELECT SUM(column_name)
FROM table_name
WHERE condition;

Example-

SELECT COUNT(ProductID)
FROM Products;
SELECT AVG(Price)
FROM Products;

SELECT SUM(Quantity)
FROM OrderDetails;


No comments:

Post a Comment

Thank You..