Data type descriptions use these conventions:

  • M indicates for each type:

    • Integer: Max display width
    • Floating: Digits that can be stored (precision)
    • String: Length
  • D for floating-point and fixed-point types.

    • Indicates number of digits following the decimal point.
    • Max possible value is 30, but should be no greater than M-2 TODO why?
  • fsp (fractional second precision) for TIME, DATETIME, and TIMESTAMP types.

    • Represent number of digits followign the decimal point for fractional parts of seconds.
  • Square brackets indicate optional parts of type definitions.

Contents

  1. Numeric Data Types
  2. String Data Types
  3. Date and time data types
  4. JSON data type
  5. Spatial data types
  6. Data type default values

Source: https://dev.mysql.com/doc/refman/8.4/en/data-types.html

Notes

Subcategories

Archived