• BOOKMARK

  • ADD TO FAVORITES

  • REFERENCES


  • MARC

    Mailing list ARChives
    - Search by -
     Subjects
     Authors
     Bodies





    FOLDOC

    Computing Dictionary




  • Text Link Ads






MySQL Column types - Quick Reference

MySQL Tutorials.

MySQL Column types - Quick Reference

New postby Ranman on Thu Mar 27, 2008 10:48 pm

# MySQL Column types - Quick Reference
#
# M = Maximum display size. (Maximum legal display size is 255)
# D = Applies to floating-point types and indicates the number
# of digits following the decimal point. (Maximum possible value
# is 30, but should be no greater than M-2)
#
# [ and ] indicate optional specifiers.
#
# Note: If you specify ZEROFILL for a column, MySQL will add
# the UNSIGNED attribute to the column automatically.
#

TINYINT[(M)] [UNSIGNED] [ZEROFILL]
Signed range: -128 to 127
Unsigned range: 0 to 255

SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
Signed range: -32768 to 32767
Unsigned range: 0 to 65535

MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
Signed range: -8388608 to 8388607
Unsigned range: 0 to 16777215

INT[(M)] [UNSIGNED] [ZEROFILL]
Signed range: -2147483648 to 2147483647
Unsigned range: 0 to 4294967295

INTEGER[(M)] [UNSIGNED] [ZEROFILL]
This is a synonym for INT

BIGINT[(M)] [UNSIGNED] [ZEROFILL]
Signed range: -9223372036854775808 to 9223372036854775807
Unsigned range: 0 to 18446744073709551615

FLOAT[(M,D)] [ZEROFILL]
Signed range: -3.402823466E+38 to -1.175494351E-38
0
1.175494351E-38 to 3.402823466E+38
Unsigned range: Cannot be unsigned

DOUBLE[(M,D)] [ZEROFILL]
Signed range: -1.7976931348623157E+308 to -2.2250738585072014E-308
0
2.2250738585072014E-308 to 1.7976931348623157E+308
Unsigned range: Cannot be unsigned

DOUBLE PRECISION[(M,D)] [ZEROFILL]
This is a synonym for DOUBLE

REAL[(M,D)] [ZEROFILL]
This is a synonym for DOUBLE

DECIMAL[(M[,D])] [ZEROFILL]
An unpacked floating-point number
Unsigned range: Cannot be unsigned

NUMERIC(M,D) [ZEROFILL]
This is a synonym for DECIMAL

DATE
1000-01-01 to 9999-12-31

DATETIME
1000-01-01 00:00:00 to 9999-12-31 23:59:59

TIMESTAMP[(M)]
1970-01-01 00:00:00 to Sometime in the year 2037

TIME
-838:59:59 to 838:59:59

YEAR[(2|4)]
1901 to 2155

CHAR(M) [BINARY]
Fixed-length string that is always right-padded with spaces
to the specified length when stored

[NATIONAL] VARCHAR(M) [BINARY]
Variable-length string

TINYBLOB
TEXT column with a maximum length of 255

TINYTEXT
BLOB column with a maximum length of 255

BLOB
BLOB column with a maximum length of 65535

TEXT
TEXT column with a maximum length of 65535

MEDIUMBLOB
BLOB column with a maximum length of 16777215

MEDIUMTEXT
TEXT column with a maximum length of 16777215

LONGBLOB
BLOB column with a maximum length of 4294967295

LONGTEXT
TEXT column with a maximum length of 4294967295

ENUM('value1','value2',...)
Maximum of 65535 distinct values

SET('value1','value2',...)
Maximum of 64 members
User avatar
Ranman
Site Admin
 
Posts: 25
Joined: Thu Mar 27, 2008 12:27 am

Return to MySQL Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

  • MORE RESOURCE


  • Linux

    The Distributions





    Linux

    The Software





    Linux

    The News



  • MARKETING






  • Toll Free