SQL Function

SQL Avg()

Author: Webetutorial, Posted On: ago

The AVG() returns the average value of a numeric column. Syntax:- SELECT AVG(column_name) FROM table_name; Example:- The subsequent SQL gets the average value of the “Price” column from the “Hosting” table:- SELECT AVG(Price) AS PriceAverage Read more…

SQL Function

SQL Count()

Author: Webetutorial, Posted On: ago

The COUNT() returns the number of column or rows that matches a specified criteria. Syntax:- The COUNT(column_name) returns the number of values of the specified column:- SELECT COUNT(column_name) FROM table_name; OR SELECT COUNT(*) FROM table_name; Read more…

SQL Function

SQL First()

Author: Webetutorial, Posted On: ago

The FIRST() function returns the first value of the selected column. Syntax:- SELECT FIRST(column_name) FROM table_name; OR SELECT column_name FROM table_name ORDER BY column_name ASC LIMIT 1; Example:- The subsequent SQL selects the first value Read more…

SQL Function

SQL Last()

Author: Webetutorial, Posted On: ago

The LAST() returns the last value of the selected column. Syntax:- SELECT LAST(column_name) FROM table_name; OR SELECT column_name FROM table_name ORDER BY column_name DESC LIMIT 1; Example:- The subsequent SQL selects the last value of Read more…

SQL Function

SQL Max()

Author: Webetutorial, Posted On: ago

The MAX() function returns the largest value of the selected column. Syntax:- SELECT MAX(column_name) FROM table_name; Example:- The subsequent SQL gets the largest value of the “Price” column from the “Hosting” table:- SELECT MAX(Price) AS Read more…

SQL Function

SQL Min()

Author: Webetutorial, Posted On: ago

The MIN() function returns the smallest value of the selected column. Syntax:- SELECT MIN(column_name) FROM table_name; Example:- The subsequent SQL gets the value of the “Price” column from the “Hosting” table:- SELECT MIN(Price) AS OrderPrice Read more…

SQL Function

SQL Sum()

Author: Webetutorial, Posted On: ago

The SUM() returns the sum of a numeric column. Syntax:- SELECT SUM(column_name) FROM table_name; Example:- The subsequent SQL finds the sum of all the “Visits” fields for the “VisitNumbers” table:- SELECT SUM(Visits) AS TotalVisitNumbers FROM Read more…

SQL Function

SQL Group By

Author: Webetutorial, Posted On: ago

The GROUP BY is used in conjunction with the aggregate functions to group the result-set by columns. Syntax:- SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name; Example:- If, we want to Read more…

SQL Function

SQL Having

Author: Webetutorial, Posted On: ago

The HAVING was added to SQL because the WHERE keyword cannot be used with aggregate functions. Syntax:- SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value; Example:- Now Read more…

SQL Function

SQL Ucase()

Author: Webetutorial, Posted On: ago

The UCASE() converts the value of a field to uppercase. Syntax:- SELECT UCASE(column_name) FROM table_name; Example:- The subsequent SQL selects the “VisitorName” and “City” columns from the “Visitors” table, and converts the “VisitorName” column to Read more…