sql tutorial

SQL MID() Function

Submitted by admin on

The MID() function is used to extract values from a column. The MID() contain three (3) parameters. The first one is used to select which column to extract, the second one is the starting position, the last one is the number of characters to be extracted.

SQL MID() Syntax

SQL AVG() Function

Submitted by admin on

The AVG function calculates the average of a specified column. It works only on a numeric column. It first sums up all data and then divides it by the total number of rows.For example if the sum of 5 items is 10 then average is 10/5 = 2.

SQL AVG() Syntax

SQL FIRST Function

Submitted by admin on

The FIRST function returns the first value of the selected column. FIRST function is not standard SQL function so it cannot be used with other DBMS like MySQL. However this is very useful with MS Access OR SQL Server.

SQL FIRST() Syntax

SQL LEN() Function

Submitted by admin on

The LEN function is useful to count the number of characters in a column you specified as the parameter. LEN is short for length. The LEN function returns the number of characters including spaces or any character within that column.

You can use SQL Alias to name the result of the LEN function.

SQL LEN() Syntax