MIN() Syntax
SELECT MIN(column_name)
FROM table_name
WHERE condition;
FROM table_name
WHERE condition;
MAX() Syntax
SELECT MAX(column_name)
FROM table_name
WHERE condition;
FROM table_name
WHERE condition;
Example-
SELECT MIN(Price) AS SmallestPrice
FROM Products;
FROM Products;
SELECT MAX(Price) AS LargestPrice
FROM Products;
FROM Products;
COUNT() Syntax
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
FROM table_name
WHERE condition;
AVG() Syntax
SELECT AVG(column_name)
FROM table_name
WHERE condition;
FROM table_name
WHERE condition;
SUM() Syntax
SELECT SUM(column_name)
FROM table_name
WHERE condition;
FROM table_name
WHERE condition;
Example-
SELECT COUNT(ProductID)
FROM Products;
FROM Products;
SELECT AVG(Price)
FROM Products;
FROM Products;
SELECT SUM(Quantity)
FROM OrderDetails;
FROM OrderDetails;
No comments:
Post a Comment
Thank You..