Difference between revisions of "TYPES"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
==AVG() Returns the Average of Values == | ==AVG() Returns the Average of Values == | ||
SELECT AVG(cost) | |||
FROM books; | |||
==COUNT() Returns the number or rows == | ==COUNT() Returns the number or rows == |
Revision as of 13:53, 7 November 2017
MIN()Returns the smallest Value
SELECT COUNT(*), SUM(TOTAL_AMOUNT), MIN(TOTAL_AMOUNT) from sales;
Returns the count in one column, the sum of the total_amount column and Min amount
MAX() Returns the largest Value
SUM() Returns the sum of values
SELECT COUNT(*), SUM(TOTAL_AMOUNT) from sales;
Returns the count in one column and the sum of the total_amount column
AVG() Returns the Average of Values
SELECT AVG(cost) FROM books;
COUNT() Returns the number or rows
SELECT COUNT(*) FROM SALES
Returns the record count