Loading

MySQL Data Type

Data type mainly defines which type of data an object can hold. The data type property is very important for optimizing the database. That means, As per our requirement,  only those types and sizes of fields we will use. Like if our requirement is only 5 characters, then we will not use 10 character data type field.

There are the following categories of data types:-

  • Numeric data type:- MySQL supports all standard SQL numeric data types Like- BIT, TINYINT, BOOL, BOOLEAN, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, FLOAT(M, D), DOUBLE(M, D), DOUBLE PRECISION(M, D), DECIMAL(M, D), DEC

All the numeric data types may have some extra options like- UNSIGNED OR ZEROFILL.

If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column.

ZEROFILL deprecated from MySQL version 8.0.17

UNSIGNED deprecated from MySQL version 8.0.17 for a column of type FLOAT, DOUBLE, and DECIMAL.

  • Date and Time:- The date and time data types for representing temporal values are DATE, TIME, DATETIME, TIMESTAMP, and YEAR. Date and time data types are DATE, DATETIME, TIMESTAMP, TIME, and YEAR.
  • String Data Type:- The string data types are CHAR, VARCHAR, BINARY, VARBINARY, BLOB, TEXT, ENUM, and SET.

Read Also:-

BIT MySQL Data Type
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT MySQL Data Type
BOOLEAN, FLOAT, DOUBLE, DECIMAL MYSQL Data Type
CHAR and VARCHAR MySQL Data Type
ENUM MySQL Data Type
MYSQLSET Data Type
MySQL BINARY and VARBINARY Data Type

For more detail about Data Type, Please visit Mysql Manual

Share with:


Leave a Reply

Connect with:

z35W7z4v9z8w
Verified by ExactMetrics