Database Reference
In-Depth Information
Part IV. Built-In Functions
MySQL has many built-in functions that can be used to manipulate data contained within
columns. With these functions, you can format data, extract text, or create search expres-
sions. In and of themselves, functions do not affect data within columns. Instead, they ma-
nipulate data within results of queries. However, when used properly within SQL state-
ments such as UPDATE , they can be a tool for changing data within columns. Incidentally,
functions can be used for processing plain text or numbers — they don't require that data
come from a column.
There are three major groupings of functions: string functions; date and time functions; and
numeric or arithmetic functions. String functions are functions that relate to formatting and
converting text, as well as finding and extracting text from columns. These are covered in
Chapter10 .
Date and time functions are covered in Chapter11 . These functions can be used for format-
ting date and time values, as well as extracting specific values from a given date or time.
They can also be used to get date and time values from the system to use for inserting or
updating data in columns of a table.
The numeric or arithmetic functions are used for mathematical or statistical calculations on
data. They are covered in Chapter12 .
These three chapters will include the most popular and more useful functions from these
three major groups of functions, but not all functions from these categories. As part of
learning and developing MySQL and MariaDB, you should be aware of these functions,
and learn them well.
Search WWH ::




Custom Search