ZEROFILL,UNSIGNED,SERIAL,SERIAL DEFAULT VALUE : Introduction « Data Types « MySQL Tutorial






A 'ZEROFILL' numeric column will add the UNSIGNED attribute to the column.

UNSIGNED numeric data types also allow SIGNED.

UNSIGNED numeric data types are signed by default.

SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.

SERIAL DEFAULT VALUE in the definition of an integer column is an alias for NOT NULL AUTO_INCREMENT UNIQUE.

The ZEROFILL can display leading zeros of a number based on the display width.

For example, if you declare an INT(8) ZEROFILL, and the value you're storing is 23, it will be displayed as 00000023.









10.16.Introduction
10.16.1.The basic datatypes
10.16.2.Date Datatypes
10.16.3.Numeric Types Storage
10.16.4.Numeric Types
10.16.5.ZEROFILL,UNSIGNED,SERIAL,SERIAL DEFAULT VALUE
10.16.6.Using Data Types from Other Database Engines
10.16.7.Data type mapping occurs at table creation time, after which the original type specifications are discarded.
10.16.8.Storage Requirements for Numeric Types
10.16.9.Storage Requirements for Date and Time Types
10.16.10.The format of the zero value for each type.