INDEX No. Article 1. Introduction of SQL 2. Table Basic 3. Keys and Constraints 4. Referential integrity 5. INDEX 6. VIEW 7. Basic Queries 8. DATATYPES 9. Basic keywords and Its uses 10. SQL Aliases 11. Date Functions 12. INSERT UPDATE and DELETE Queries 13. Filtering Results 14. Ordering Results 15. Aggregate Functions Start>>
SQL has many built-in functions for performing calculations on data. Aggregate Functions AVG() Function The AVG() function returns the average value of a numeric column. § Syntax SELECT AVG ( column_name ) FROM table_name § Example SQL statement gets the average value of the "Price" column from the "Products" table: SELECT AVG ( Price ) AS PriceAverage FROM Products SQL statement selects the "ProductName" and "Price" records that have an above average price: SELECT ProductName , Price FROM Products WHERE Price >( SELECT AVG ( Price ) FROM Products ); COUNT() Function The COUNT() function returns the number of rows that matches a specified criteria.The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column: § Syntax SELECT COUNT ( column_name ) FROM table_name ; MAX() Function The MAX() function returns the largest value of the s