Oracle Datatype Summary
Postgresql Data Types
Name | Aliases | Description |
bigint | int8 | signed eight-byte integer |
bigserial | serial8 | autoincrementing eight-byte integer |
bit | fixed-length bit string | |
bit varying(n) | varbit(n) | variable-length bit string |
boolean | bool | logical Boolean (true/false) |
box | rectangular box in the plane | |
bytea | binary data | |
character varying(n) | varchar(n) | variable-length character string |
character(n) | char(n) | fixed-length character string |
cidr | IPv4 or IPv6 network address | |
circle | circle in the plane | |
date | calendar date (year, month, day) | |
double precision | float8 | double precision floating-point number |
inet | IPv4 or IPv6 host address | |
integer | int, int4 | signed four-byte integer |
interval(p) | time span | |
line | infinite line in the plane (not fully implemented) | |
lseg | line segment in the plane | |
macaddr | MAC address | |
money | currency amount | |
numeric [ (p, s) ] | decimal [ (p, s) ] | exact numeric with selectable precision |
path | open and closed geometric path in the plane | |
point | geometric point in the plane | |
polygon | closed geometric path in the plane | |
real | float4 | single precision floating-point number |
smallint | int2 | signed two-byte integer |
serial | serial4 | autoincrementing four-byte integer |
text | variable-length character string | |
time [ (p) ] [ without time zone ] | time of day | |
time [ (p) ] with time zone | timetz | time of day, including time zone |
timestamp [ (p) ] [ without time zone ] | timestamp | date and time |
timestamp [ (p) ] with time zone | timestamptz | date and time, including time zone |
MySQL datatype
Type {storage} | Name | Range | Attributes | Default |
---|---|---|---|---|
Numeric {1 byte} | TINYINT[(M)] | -128 TO 127 [0 to 255 if UNSIGNED] | AUTO_INCREMENT UNSIGNED, ZEROFILL, SERIAL DEFAULT VALUE | NULL [0 if NOT NULL] |
Numeric {2 bytes} | SMALLINT[(M)] | -32,768 to 32,767 [0 to 65,535] | AUTO_INCREMENT, UNSIGNED, ZEROFILL, SERIAL DEFAULT VALUE | NULL [0 if NOT NULL] |
Numeric {3 bytes} | MEDIUMINT[(M)] | -8,388,608 to 8,388,607 [0 to 16,777,215] | AUTO_INCREMENT, UNSIGNED, ZEROFILL, SERIAL DEFAULT VALUE | NULL [0 if NOT NULL] |
Numeric {4 bytes} | INT[(M)] | -/+2.147E+9 [0 to 4.294E+9] | AUTO_INCREMENT, UNSIGNED, ZEROFILL, SERIAL DEFAULT VALUE | NULL [0 if NOT NULL] |
Numeric {8 bytes} | BIGINT[(M)] | -/+9.223E+18 [0 to 18.45E+18] | AUTO_INCREMENT, UNSIGNED, ZEROFILL, SERIAL DEFAULT VALUE | NULL [0 if NOT NULL] |
Numeric {4 or 8} | FLOAT(p) | p=0-24 --> "FLOAT" p=25-53 --> "DOUBLE" | UNSIGNED, ZEROFILL | NULL [0 if NOT NULL] |
Numeric {4 bytes} | FLOAT[(M,D)] | Min=+/-1.175E-38 Max=+/-3.403E+38 | UNSIGNED, ZEROFILL | NULL [0 if NOT NULL] |
Numeric {8 bytes} | DOUBLE[(M,D)] | Min=+/-2.225E-308 Max=+/-1.798E+308 | UNSIGNED, ZEROFILL | NULL [0 if NOT NULL] |
Numeric {M+2} | DECIMAL[(M,[D])] Stored as string | Max Range = DOUBLE range Fixed point vs. DOUBLE float | UNSIGNED, ZEROFILL | NULL [0 if NOT NULL] |
Bit {8 bytes} | BIT[(M)] | Binary. Display by [add zero or converting with BIN()]. M=1-64 | Prior to 5.03 TINYINT(1) Synonym | NULL [0 if NOT NULL] |
String {M char's} | CHAR[(M)] | M=0-255 Characters, FIXED. Right padded with spaces. | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {M char's1} | VARCHAR(M) | M=0-65,535 Characters M=0-255 | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {#char's1} | TINYTEXT2 | 0-255 Characters | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {#char's1} | TEXT2 | 0-65,535 Char's | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {#char's1} | MEDIUMTEXT2 | 0-16,777,215 Char's | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {#char's1} | LONGTEXT2 | 0-4,294,967,295 Char's | BINARY, CHARACTER SET | NULL ["" if NOT NULL] |
String {M bytes} | BINARY[(M)] | M=0-255 bytes, FIXED. | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {M bytes} | VARBINARY(M) | 0-65,535 bytes M=0-255 | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {#bytes1} | TINYBLOB | 0-255 bytes | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {#bytes1} | BLOB | 0-65,535 bytes | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {#bytes1} | MEDIUMBLOB | 0-16,777,215 bytes | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {#bytes1} | LONGBLOB | 0-4,294,967,295 bytes | Global Only (case sensitive) | NULL ["" if NOT NULL] |
String {1-2 bytes} | ENUM2 ("A1","A2",...) | Column is exactly 1 of 1-65,535 values | CHARACTER SET | NULL [1st value if NOT NULL] |
String {1-8 bytes} | SET2 ("A1","A2",...) | Column is 0 or more values in list of 1-64 members | CHARACTER SET | NULL ["" if NOT NULL] |
Date & Time {3 bytes} | DATE | "1000-01-01" - "9999-12-31" | Global Only (YYYY-MM-DD) | NULL ["0000-00-00" if NOT NULL] |
Date & Time {8 bytes} | DATETIME | "1000-01-01 00:00:00" - "9999-12-31 23:59:59" | Global Only (YYYY-MM-DD hh:mm:ss) | NULL ["0000-00-00 00:00:00" if NOT NULL] |
Date & Time {3 bytes} | TIME | "-838:59:59" - "838:59:59" | Global Only (hh:mm:ss) | NULL ["00:00:00" if NOT NULL] |
Date & Time {4 bytes} | TIMESTAMP | 19700101000000 - 2037+ | Global Only (YYYYMMDDhhmmss) | Current Date & Time |
Date & Time {1 bytes} | YEAR | 1900 - 2155 | Global Only (YYYY) | NULL ["0000" if NOT NULL] |
Data type in MsSQL Server
Data type | Length | Description |
---|---|---|
bigint | 8 | Integer number from -2^63 (-9 223 372 036 854 775 808) to 2^63-1 (9 223 372 036 854 775 807). |
int | 4 | Integer number from -2^31 (-2 147 483 648) to 2^31-1 (2 147 483 647). |
smallint | 2 | Integer number from -2^15 (-32 768) to 2^15-1 (32 767). |
tinyint | 1 | Integer number from 0 to 255. |
bit | 1 bit | Integer number 0 or 1. |
decimal(precision, scale) | 5-17 | Numeric data type with fixed precision and scale (precision 1-38, 18 by default and scale 0-p, 0 by default). |
numeric | 5-17 | Same as data type 'decimal'. |
money | 8 | Financial data type from -2^63 (-922 337 203 685 477.5808) to 2^63-1 (922 337 203 685 477.5807) with the precision of one ten-thousandth unit. |
smallmoney | 4 | Financial data type from -2^31 (-214 748.3648) to 2^31-1 (214 748.3647) with the precision of one ten-thousandth unit. |
float(n) | 4-8 | Numeric data type with float precision, where n is the number of mantis bits (1-24, precision of 7 digits, size of 4 bytes and 25-53, precision of 15 digits and size of 8 bytes). |
real | 4 | Numeric data type with float precision that is defined as a float(24). |
datetime | 8 | Date type representing date and time from 1.1.1753 to 31.12.9999 with precision about 3ms. Values are rounded to .000, .003 and .007. |
smalldatetime | 4 | Date type representing date and time from 1.1.1900 to 6.6.2079 with precision of 1min. Values up to 29.998 are rounded down and values from 29.999 are rounded down to the nearest minute. |
char | n | Char string of fixed length and max. length of 8000 chars. |
varchar | n | Char string of variable length and max. length of 8000 chars. |
text | n | Char string of variable length and max. length of 2^31-1 (2 147 483 647) chars. |
nchar | 2*n | Unicode char string of fixed length and max. length of 4000 chars. |
nvarchar | 2*n | Unicode char string of variable length and max. length of 4000 chars. |
ntext | 2*n | Unicode char string of variable length and max. length of 2^30-1 (1 073 741 823) chars. |
binary | n+4 | Binary data of fixed length and max. length of 8000 bytes. |
varbinary | n+4 | Binary data of variable length and max. length of 8000 bytes. |
image | n | Binary data of variable length and max. length of 2^31-1 (2 147 483 647) bytes. |
cursor | For storing the reference to cursors in a variable or in a procedure (no for CREATE TABLE). | |
sql_variant | For storing value of another type (no text, ntext, image, timestamp, sql_variant) of max. length to 8016 bytes. ODBC doesn't fully support this data type. | |
table | For storing the query result for the later usage. | |
timestamp | 8+4 | Data type generates automatically binary numbers, unique in the database, used mostly to the rows identification. There can be only column of this data type in the table. |
uniqueidentifier | Data type for storing GUID (new by means of the NEWID function or existing from the string in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, e.g. 6F9619FF-8B86-D011-B42D-00C04FC964FF). |