DB/MySQL
[mysql/ datatype] datatypes 정리
SIXXXX_
2022. 11. 2. 15:43
728x90
출처:
https://www.mysqltutorial.org/mysql-data-types.aspx
Numeric TypesDescription
TINYINT | A very small integer |
SMALLINT | A small integer |
MEDIUMINT | A medium-sized integer |
INT | A standard integer |
BIGINT | A large integer |
DECIMAL | A fixed-point number |
FLOAT | A single-precision floating point number |
DOUBLE | A double-precision floating point number |
BIT | A bit field |
Date and Time TypesDescription
DATE | A date value in CCYY-MM-DD format |
TIME | A time value in hh:mm:ss format |
DATETIME | A date and time value inCCYY-MM-DD hh:mm:ssformat |
TIMESTAMP | A timestamp value in CCYY-MM-DD hh:mm:ss format |
YEAR | A year value in CCYY or YY format |
Spatial Data TypesDescription
GEOMETRY | A spatial value of any type |
POINT | A point (a pair of X-Y coordinates) |
LINESTRING | A curve (one or more POINT values) |
POLYGON | A polygon |
GEOMETRYCOLLECTION | A collection of GEOMETRYvalues |
MULTILINESTRING | A collection of LINESTRINGvalues |
MULTIPOINT | A collection of POINTvalues |
MULTIPOLYGON | A collection of POLYGONvalues |
JSON data type
MySQL supported a native JSON data type since version 5.7.8 that allows you to store and manage JSON documents more effectively. The native JSON data type provides automatic validation of JSON documents and optimal storage format.
In this tutorial, you have learned various MySQL data types that help you determine which data type you should use for columns when you create tables.