This appendix lists the available data types for each Relational Database Management System (RDBMS) and briefly describes the most commonly used types for each database platform.
Table C-1 summarizes the column data types available in the various RDBMSs used in this book.
Category |
Access |
SQL Server |
Oracle |
MySQL |
DB2 |
---|---|---|---|---|---|
Binary Object |
OLE Object, Memo |
binary, varbinary, Image |
bfile, BLOB, long raw |
blob, text |
blob |
Bit |
Yes/No (synonyms for tinyint(1)) |
bit |
byte |
bit, bool |
N/A |
Character |
Text, Memo |
char, nchar, varchar, nvarchar, text, ntext |
char, nchar, long, varchar, nvarchar, CLOB |
char, nchar, varchar, nvarchar, mediumtext, longtext |
char, varchar, longvarchar, CLOB |
Currency |
Currency |
money, smallmoney |
N/A |
N/A |
N/A |
Numeric |
Number |
bigint, decimal, float, int, numeric, real, smallint, tinyint |
number (decimal, numeric, double precision, float, integer, smallint) |
bigint, decimal, double, int, mediumint, numeric, real, smallint, tinyint |
bigint, decimal/numeric, double/float, integer, smallint, real |
Temporal |
Date/Time |
datetime, smalldatetime |
date |
datetime, time, timestamp, year |
date, time, timestamp |
Unique |
AutoNumber |
unique identifier |
N/A |
N/A |
N/A |
Table C-2 describes the SQL Server data types.
Table C-3 describes the Oracle data types.
Table C-4 describes the DB2 data types.
Table C-5 describes the MySQL data types.
Table C-6 shows the Access field types listed with JET SQL equivalents.
Category |
Data Types |
Description |
---|---|---|
Binary Object |
OLE Object (longbinary) |
A variable-length text or BLOB field with a maximum of 4,294,967,295 characters. Longbinary is the Jet name for this data type. |
Boolean |
Yes/No (boolean) |
Stores values of -1 for yes/true, 0 for no/false. Any non-zero value input into this field is stored as -1. |
Character |
Text (char, varchar, string) |
Can store up to 255 characters. Jet equivalents of a Text field are alphanumeric, char, varchar, and string. |
Memo (longtext, longchar, memo, note) |
Can store up to 64,000 characters of alphanumeric data. |
|
Numeric |
Number (byte, int / integer, single, long, double) |
The number field can be defined as one of the Jet types of byte, int, integer, single, double, and long. Sizes are: byte: 1 byte int, integer: 2 bytes single, long: 4 bytes double: 8 bytes |
Currency |
Currency (currency, money) |
Precision up to 4 decimal places. Eight bytes. |
Unique |
Autonumber (counter, autoincrement, GUID) |
counter and autoincrement use a long field type with a unique constraint and autonumbering functionality. Size: 4 bytes. This is the default size when generating an autonumbering field in Access table design view. GUID stores up to 16 bytes. |
Other |
Hyperlink (longtext, longchar, memo, note) |
Stores up to 2,048 bytes of Uniform Resource Locator (URL) data. |