SQL Data Types for MySQL, SQL Server, and MS Access
Different database management systems (DBMS) have their own specific data types in addition to the common SQL data types. Here are some of the SQL data types supported by MySQL, SQL Server, and Microsoft Access, along with some DBMS-specific types:
MySQL Data Types:
Numeric Data Types:
TINYINT
,SMALLINT
,MEDIUMINT
,INT
,BIGINT
: For integers of varying sizes.DECIMAL
,NUMERIC
: For fixed-point numbers.FLOAT
,DOUBLE
: For floating-point numbers.
Character String Data Types:
CHAR(n)
,VARCHAR(n)
: For character strings.TEXT
: For large text values.ENUM
,SET
: For enumerated and set types.
Date and Time Data Types:
DATE
,TIME
,DATETIME
: For date and time values.TIMESTAMP
: For timestamp values.
Binary Data Types:
BINARY(n)
,VARBINARY(n)
: For binary strings.BLOB
: For large binary objects.
Boolean Data Type:
BOOLEAN
orBOOL
: Represents true or false values.
JSON Data Types:
JSON
: For JSON data.
Spatial Data Types:
GEOMETRY
,POINT
,LINESTRING
,POLYGON
, and others: For geographic information systems (GIS) and spatial data.
SQL Server Data Types:
Numeric Data Types:
TINYINT
,SMALLINT
,INT
,BIGINT
: For integers.DECIMAL
,NUMERIC
: For fixed-point numbers.REAL
,FLOAT
: For floating-point numbers.MONEY
,SMALLMONEY
: For currency values.
Character String Data Types:
CHAR(n)
,NCHAR(n)
,VARCHAR(n)
,NVARCHAR(n)
: For character strings.TEXT
,NTEXT
: For large text values.
Date and Time Data Types:
DATE
,TIME
,DATETIME2
: For date and time values.SMALLDATETIME
,DATETIMEOFFSET
: For date and time values with different precisions.
Binary Data Types:
BINARY(n)
,VARBINARY(n)
: For binary data.IMAGE
: For large binary objects.
-
Boolean Data Type:
BIT
: Represents true or false values.
-
XML Data Type:
XML
: For storing XML data.
-
HierarchyID Data Type:
HIERARCHYID
: For representing hierarchical data.
Microsoft Access Data Types:
-
Numeric Data Types:
BYTE
,INTEGER
,LONG
,SINGLE
,DOUBLE
: For various numeric types.CURRENCY
: For currency values.
-
Character String Data Types:
TEXT(n)
: For text values.MEMO
: For large text values.CHAR
,NCHAR
,VARCHAR
,NVARCHAR
: For Unicode text.
-
Date and Time Data Types:
DATE
,TIME
,DATETIME
: For date and time values.
-
Binary Data Types:
BINARY(n)
: For binary data.
-
Boolean Data Type:
YESNO
: Represents yes/no or true/false values.
-
OLE Object Data Type:
OLEOBJECT
: For objects like images or files.
These are some of the data types supported by MySQL, SQL Server, and Microsoft Access. Each DBMS may have additional data types or variations in their implementations, so it's important to consult the documentation specific to your chosen database system when designing your database schema.
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Copyright 2023-2025 © All rights reserved.