General Data Types
General Data Types
Each column in a database table is required to have a name and a data type.
SQL developers have to decide what types of data will be stored inside each and
every table column when creating a SQL table. The data type is a label and a
guideline for SQL to understand what type of data is expected inside of each column,
and it also identifies how SQL will interact with the stored data.
The following table lists the general data types in SQL:
Data type
Description
CHARACTER(n)
VARCHAR(n) or
CHARACTER VARYING(n)
BINARY(n)
BOOLEAN
VARBINARY(n) or
BINARY VARYING(n)
INTEGER(p)
SMALLINT
INTEGER
BIGINT
DECIMAL(p,s)
NUMERIC(p,s)
FLOAT(p)
REAL
FLOAT
DOUBLE PRECISION
DATE
TIME
TIMESTAMP
INTERVAL
ARRAY
MULTISET
XML
Access
SQLServer
Oracle
MySQL
boolean
Yes/No
Bit
Byte
N/A
integer
Number (integer)
Int
Number
Int
Integer
float
Number (single)
Float
Real
Number
Float
currency
Currency
Money
N/A
N/A
string (fixed)
N/A
Char
Char
Char
string (variable)
Text (<256)
Memo (65k+)
Varchar
Varchar
Varchar2
Varchar
binary object
Long
Raw
Blob
Text