mysql commonly used data types

  MySQL is a relational database management systems, relational database stores data in separate tables rather than putting all the data in a large warehouse, thus increasing the speed and improved flexibility. MySQL SQL language used is the most common standardized language used to access databases. MySQL software uses a dual licensing policy, divided communities and commercial versions, because of its small size, high speed, low cost of ownership, especially open source this feature, the development of small and medium websites have chosen MySQL as the database website

  With other languages, also has its own data type, here to tell you about mysql commonly used data types:

  Integer type byte range (signed) range (unsigned) use

  

  FLOAT 4 bytes (-3.402 823 466 E + 38,1.175 494 351 E-38), 0, (1.175 494 351 E-38,3.402 823 466 351 E + 38) 0, (1.175 494 351 E-38,3.402 823 466 E + 38) single-precision floating-point value

  DOUBLE 8 bytes (1.797 693 134 862 315 7 E + 308,2.225 073 858 507 201 4 E-308), 0, (2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E + 308) 0 , (2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E + 308) double precision floating point value

  DECIMAL of DECIMAL (M, D), if M> D, the value is a small value of M + 2 or D + 2 depends on the value of M depends on M and D and D

  Optional integer attribute column

  M: width (filled with 0 when it makes sense)

  unsigned: unsigned type (non-negative)

  zerofill: 0 filler, (unsigned default)

  Date and Time Types

  DATE 3 bytes

  DATETIME 8 bytes

  TIMESTAMP 4 bytes

  TIME 3 bytes

  YEAR 1 byte, may also exist in 0000

  String type

  Special type NULL

  NULL is not fake, not real, but "empty"

  Any operator determines character encountered NULL, NULL had

  NULL judgment can only use is null, is not null

  NULL affect query speed, generally avoid the value is NULL

 

  By use of each data type, range, etc. represents a summary of understanding, then according to the selected storage engine to determine how to select the appropriate data type. In exchange for higher performance with a smaller database storage costs.

Guess you like

Origin www.cnblogs.com/songtianfa/p/11249456.html