Info
Open the page on your phone

MySQL data types

MySQL supports the following data types:

  • Text types: VARCHAR, CHAR, TEXT, BLOB, CLOB
  • Numeric types: INT, TINYINT, SMALLINT, MEDIUMINT, BIGINT, FLOAT, DOUBLE, DECIMAL
  • Date and time types: DATE, TIME, DATETIME, TIMESTAMP
  • Special types: ENUM, SET, JSON, BIT
  • Choosing the data type for each field in a table is an important decision, as it affects the efficiency of the database. For example, if a field contains only short text values, then the VARCHAR(255) type can be used. If a field contains long text values, then the TEXT or BLOB type can be used. If a field contains numbers, then the INT or SMALLINT type can be used for small numbers or the BIGINT type for large numbers.

    More detailed information about MySQL data types can be found in the documentation: https://dev.mysql.com/doc/refman/8.0/en/data-types.html: https://dev.mysql.com/doc/refman/8.0/en/data-types.html.