|
Data Type |
Data Type |
Description |
|
|
|
Oracle |
MySQL |
|
Value Type |
Number (P, S) |
Stores numeric data types, such as floating point, integer, score, and dual-precision. Where p is the precision, indicating the total number of digits (1 <= P <= 38); s is the range, indicating the number of digits on the right of the decimal point, which is between-84 and 127. The default value is 38 characters. |
|
|
Tinyint |
|
Tiny integer, 1 byte |
|
Smallint |
|
Small integer, 2 bytes |
|
Mediumint |
|
Medium integer, 3 bytes |
|
Int or integer |
Integer Data Type |
Integer, 4 bytes |
|
Bigint |
|
Big integer, 8 bytes |
|
Float |
Floating Point Data Type |
Single-precision floating point value, 4 bytes |
|
Double |
|
Double-precision floating point value, 8 bytes |
|
Decimal |
|
For decimal (M, d), if M> D is m + 2, otherwise d + 2 |
|
String type |
Char (N) |
N = 1to2000 bytes, fixed length string, n Bytes long. If no length is specified, the default value is 1 byte long (one Chinese character is 2 bytes) |
Fixed-length string, 0-bytes |
|
Nchar (N) |
NLS (National Language Support, international language support) data types can only store UNICODE character sets defined by the database NLS character set. Oracle can store up to 2000 bytes |
|
Varchar (N) |
A maximum of B can be stored in a variable length. Therefore, no space is required to fill in. |
Variable-length string, 0-255 bytes |
|
Nvarchar (N) |
N = 1to4000 bytes. A maximum of B bytes can be stored in a variable length. Therefore, no space is required for Supplement. |
NLS (National Language Support, international language support) data types can only store UNICODE character sets defined by the database NLS character set. |
|
Varchar2 (N) |
Varchar2 is more suitable for use than varchar. Due to compatibility, varchar remains in the Oracle database. |
|
|
Nvarchar2 |
The data type of NLS is equivalent to that of varchar2. This data type can be stored at most B. |
|
|
Clob |
Stores a large amount of single-byte character data and multi-byte character data. The maximum storage capacity is 4 GB. |
|
|
Nclob |
It stores variable-length Unicode Character Set character data with a maximum storage capacity of 4 GB. |
|
|
Blob |
Stores large binary objects. Example: graphics, video, audio, etc. |
|
|
Bfile |
Bfile: Specifies the file locator. It points to a binary file located in the file system of the server (storing a file path) |
|
|
Long |
Storage of variable-length character data, up to 2 GB. |
|
|
Raw |
Stores byte-based data. A maximum of 2000 bytes can be stored. The size must be specified. Raw data can be indexed. |
|
|
Long raw |
Stores binary data of variable length. The maximum storage capacity is 2 GB. Cannot be indexed. |
|
|
Tinyblob |
|
A binary string of no more than 255 characters, ranging from 0 to bytes. |
|
Tinytext |
|
Short text string, 0-255 bytes |
|
Blob |
|
Long text data in binary format, 0-65 535 bytes |
|
Text |
|
Long text data, 0-65 535 bytes |
|
Mediumblob |
|
Moderate-length text data in binary format |
|
Mediumtext |
|
Medium-length text data, 0-16 777 215 bytes |
|
Logngblob |
|
Extremely large text data in binary format, 0-4 294 967 295 bytes |
|
Longtext |
|
Large text data, 0-4 294 967 295 bytes |
|
Date and Time |
Date |
The date and time data of the table are stored in seven bytes. Each byte is stored in Century, year, month, day, hour, minute, and second. The value ranges from January 1, 4712 BC to December 31, 9999 AD. The sysdate function in Oracle returns the current date and time. |
Date, YYYY-MM-DD |
|
Timestamp |
The hour, minute, and second values of the year, month, day, and time of the storage date. The second value is accurate to the last six digits of the decimal point and contains the time zone information. The imestamp function in Oracle returns the current date, time, and time zone. |
|
|
Time |
|
Time Value or duration, HH: mm: SS |
|
Year |
|
Year Value, yyyy |
|
Datetime |
|
Mixed date and time, YYYY-MM-DD hh: mm: SS |
|
Timestamp |
|
Mixed Date and Time Value, timestamp, yyyymmdd hhmmss |
|
Composite Type |
Enum |
|
An Enum type can contain a maximum of 65536 elements, one of which is retained by MySQL and used to store error information. This error value is represented by index 0 or an empty string. |
|
Set |
|
Container type. A set type can contain up to 64 elements and cannot contain two identical elements. |