SQL Avg()

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” … Continue reading “SQL Avg()”

March 1, 2016 webetutorial

SQL Count()

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; … Continue reading “SQL Count()”

March 1, 2016 webetutorial

SQL First()

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 … Continue reading “SQL First()”

March 1, 2016 webetutorial

SQL Last()

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 … Continue reading “SQL Last()”

March 1, 2016 webetutorial

SQL Max()

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 … Continue reading “SQL Max()”

March 1, 2016 webetutorial

SQL Min()

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” … Continue reading “SQL Min()”

March 1, 2016 webetutorial

SQL Sum()

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:- … Continue reading “SQL Sum()”

March 1, 2016 webetutorial

SQL Group By

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; … Continue reading “SQL Group By”

March 1, 2016 webetutorial

SQL Having

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 … Continue reading “SQL Having”

February 28, 2016 webetutorial

SQL Ucase()

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 … Continue reading “SQL Ucase()”

February 28, 2016 webetutorial

SQL Lcase()

The LCASE() converts the value of a field to lowercase. Syntax:- SELECT LCASE(column_name) FROM table_name; Example:- The subsequent SQL selects the “VisitorName” and “City” columns from the “Visitors” table, and … Continue reading “SQL Lcase()”

February 28, 2016 webetutorial

SQL Mid()

The MID() is used to extract characters from a text field. Syntax:- SELECT MID(column_name,start,length) AS some_name FROM table_name; Example:- The subsequent SQL selects the first three characters from the “City” … Continue reading “SQL Mid()”

February 28, 2016 webetutorial

SQL Len()

The LEN() returns the length of the value in a text field. SQL LEN() Syntax:- SELECT LEN(column_name) FROM table_name; SQL LEN() Example:- The subsequent SQL selects the “VisitorName” and the … Continue reading “SQL Len()”

February 24, 2016 webetutorial

SQL Round()

The ROUND() is used to round a numeric to the number of decimals specified. SQL ROUND() Syntax:- SELECT ROUND(column_name,decimals) FROM table_name; SQL ROUND() Example:- The subsequent SQL selects the name … Continue reading “SQL Round()”

February 24, 2016 webetutorial
X
Subscribe to our newsletter
Subscribe to our newsletter today to receive updates on the latest news and offers.
100% Privacy. No spam guaranteed
webe tutorial
Menu