0% found this document useful (0 votes)
25 views

SQL General Data

This document provides a summary of common SQL data types including character, numeric, date/time, and other types. It lists the data type name, description, and examples of precision and scale for exact numeric types. A second table provides a quick reference to common SQL data types and their equivalents across different database systems like SQL Server, Oracle, MySQL, and PostgreSQL.

Uploaded by

Madalina Moise
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

SQL General Data

This document provides a summary of common SQL data types including character, numeric, date/time, and other types. It lists the data type name, description, and examples of precision and scale for exact numeric types. A second table provides a quick reference to common SQL data types and their equivalents across different database systems like SQL Server, Oracle, MySQL, and PostgreSQL.

Uploaded by

Madalina Moise
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL General Data Types

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

SQL Data Type Quick Reference

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)

You might also like