When creating a MySQL table, specifying a data type for every field is necessary. This data type plays an important role in enforcing the integrity of the data in a MySQL database and in making this data easier to use and manipulate. MySQL offers a number of different data types, which are summarized below.
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT : Integer values
FLOAT : Single-precision floating-point values
DOUBLE : Double-precision floating-point values
DECIMAL : Decimal values
BIT : Bit-field values
CHAR : Fixed-length strings up to 255 characters
VARCHAR : Variable-length strings up to 255 characters
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB : Binary data
TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT : Text blocks
DATE : Date values
TIME : Time values or durations
YEAR : Year values
DATETIME,TIMESTAMP : Combined date and time values
ENUM,SET : Predefined sets of values
Source of Information : MCGraw Hill - SQL the Complete Reference 3rd Edition
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT : Integer values
FLOAT : Single-precision floating-point values
DOUBLE : Double-precision floating-point values
DECIMAL : Decimal values
BIT : Bit-field values
CHAR : Fixed-length strings up to 255 characters
VARCHAR : Variable-length strings up to 255 characters
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB : Binary data
TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT : Text blocks
DATE : Date values
TIME : Time values or durations
YEAR : Year values
DATETIME,TIMESTAMP : Combined date and time values
ENUM,SET : Predefined sets of values
Source of Information : MCGraw Hill - SQL the Complete Reference 3rd Edition
|
0 comments
Post a Comment