For each data type, the syntax shown uses square brackets (
) to indicate optional parts of the syntax. The following example shows how
BIGINT is explained in this chapter:
This indicates that you can use
BIGINT alone or with a display size value. The italics indicate that you do not enter
display_size literally, but instead enter your own value. Possible uses of
In addition to the
BIGINT type, many other MySQL data types support the specification of a display size. Unless otherwise specified, this value must be an integer between 1 and 255.
Before MySQL 5, MySQL would silently change column values in certain circumstances. As of MySQL 5, these silent changes no longer happen.
When the specified
VARCHAR column size is less than four characters, it is converted to
When a table has at least one column of a variable length, all
CHAR columns greater than three characters in length are converted to
Display sizes for
TIMESTAMP fields must be an even value between 2 and 14. A display size of 0 or greater than 14 converts the field to a display size of 14. An odd-valued display size is converted to the next highest even value. MySQL 5 no longer takes a size value for timestamps.
MySQL supports all ANSI SQL2 numeric data types. MySQL numeric types break down into integer, decimal, and floating point types. Within each group, the types differ by the amount ...