A Gentle Introduction to

SQL

GISQ: How to use functions

You may need to "Tidy up" before trying these.

Most SQL implementations offer a large number of functions to manipulate strings and perform complex calculations. Unfortunately each implementation has its own suit with different names.

Concatenate strings.
Concatenation means "stick strings together".
In this example we concatenate three strings, name and region are string attributes of the table, ' is a country ' is a string literal.

oracle
access
mysql
Substring: Extracting part of a string.
SUBSTRING

oracle
access
mysql
lower case
UPPER CASE is similar.

oracle
access
mysql
Finding a substring in a string
Here we extract the first word of a country name

oracle
access
mysql
Formatting numbers to two decimal places.
This rounds up or down

oracle
access
mysql
Replace a NULL with a specific value

oracle
access
mysql
Conditional values

oracle
access
mysql