MySQL provides types for date and time and combination of date and time. In addition, MySQL also provide timestamp data type for tracking last change on a record. If you just want to store the year without date and month, you can use YEAR data type. Here is the table which showing MySQL date and type data types:
Date and Time Types
|
Description
|
DATE | A date value in ‘YYYY-MM-DD’ format |
TIME | A time value in ‘hh:mm:ss’ format |
DATETIME | A date and time value in ‘YYYY-MM-DD hh:mm:ss’ format |
TIMESTAMP | A timestamp value in ‘YYYY-MM-DD hh:mm:ss’ format |
YEAR | A year value in YYYY or YY format |
Spatial Data Types
MySQL support many spatial data types as below table which contains various kind of geometrical and geographical values.
Spatial Data Types
|
Description
|
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 GEOMETRY values |
MULTILINESTRING | A collection of LINESTRING values |
MULTIPOINT | A collection of POINT values |
MULTIPOLYGON | A collection of POLYGON values |
0 comments:
Post a Comment