SQL General Data
SQL General Data
Data type
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
Description
Character string. Fixed-length n
Character string. Variable length. Maximum length n
Binary string. Fixed-length n
Stores TRUE or FALSE values
Binary string. Variable length. Maximum length n
Integer numerical (no decimal). Precision p
Integer numerical (no decimal). Precision 5
Integer numerical (no decimal). Precision 10
Integer numerical (no decimal). Precision 19
Exact numerical, precision p, scale s. Example: decimal(5,2) is a
number that has 3 digits before the decimal and 2 digits after the
decimal
Exact numerical, precision p, scale s. (Same as DECIMAL)
Approximate numerical, mantissa precision p. A floating number in
base 10 exponential notation. The size argument for this type
consists of a single number specifying the minimum precision
Approximate numerical, mantissa precision 7
Approximate numerical, mantissa precision 16
Approximate numerical, mantissa precision 16
Stores year, month, and day values
Stores hour, minute, and second values
Stores year, month, day, hour, minute, and second values
Composed of a number of integer fields, representing a period of
time, depending on the type of interval
A set-length and ordered collection of elements
A variable-length and unordered collection of elements
Stores XML data
Data type
boolean
integer
float
currency
string (fixed)
string
(variable)
binary object
Access
Yes/No
Number
(integer)
Number
(single)
Currency
N/A
Text (<256)
Memo (65k+)
OLE Object
Memo
SQLServer
Bit
Oracle
Byte
Int
Number
Float
Real
Money
Char
Varchar
MySQL
N/A
Int
Integer
PostgreSQL
Boolean
Int
Integer
Number
Float
Numeric
N/A
Char
Varchar
Varchar2
N/A
Char
Money
Char
Varchar
Varchar
Blob
Text
Binary
Varbinary
Binary (fixed up to
8K)
Long
Varbinary (<8K) Raw
Image (<2GB)