Table of Contents
YEAR(2)Limitations and Migrating to
MySQL supports a number of SQL data types in several categories: numeric types, date and time types, and string (character and byte) types. This chapter provides an overview of these data types, a more detailed description of the properties of the types in each category, and a summary of the data type storage requirements. The initial overview is intentionally brief. The more detailed descriptions later in the chapter should be consulted for additional information about particular data types, such as the permissible formats in which you can specify values.
MySQL also supports extensions for handling spatial data. For information about these data types, see Section 12.18, "Spatial Extensions".
Data type descriptions use these conventions:
M indicates the maximum display width for integer types. For
floating-point and fixed-point types,
M is the total number of
digits that can be stored (the precision). For string types,
is the maximum length. The maximum permissible value of
depends on the data type.
fsp applies to the
TIMESTAMP types and represents fractional seconds precision; that is, the
number of digits following the decimal point for fractional parts of seconds. The
fsp value, if given, must be in the range 0 to 6. A value
of 0 signifies that there is no fractional part. If omitted, the default precision is 0. (This differs
from the standard SQL default of 6, for compatibility with previous MySQL versions.)