Oracle Database Type

Source: Internet
Author: User

Oracle Database Type

Character type
char[(length)] fixed length character up to 2000 bytes
varchar2[(length)] variable-length character data type with a maximum of 4000 bytes
nchar[(length)] fixed-length character data type, composed of international character language (national language Support,nls) character set characters, up to 2000 bytes
Long variable-length character data type up to 2GB
Raw raw binary data type, up to 2000 bytes
Long raw binary data type, up to 2GB
A 12-byte address in the RAWID database that locates a row on the disk and the object it points to
Urawid Universal Rawid, used for tables, is a representation of a row primary key
Large Object
Blob large raw binary object, maximum length 4GB
CLOB large character object, maximum length 4GB
NCLOB large character data consisting of NLS character set characters, maximum length 4GB
BFILE provides binary access to operating system files that are stored outside of the Oracle database, with a maximum of 4GB
Date type
Date-Width 7-byte datetime data type with 7 attributes: Century, year, month, day, hour, minute, second
Timestamp 7-byte or 12-byte fixed-width date/Time data type, which can contain fractional seconds when different from date, and up to 9 digits in decimal point
Timestamp with time Zorn provides support for timezone
Timestamp with local time Zorn for timezone-sensitive temporal types
Interal year to month period for the date and timestamp types can be added and reduced
Interval day to second storage days/hour/minute/second time period, support 9-bit fractional seconds
Data type
number[(Precision[,scale])] Scope 1~38
Number of digits in precision (precision) numbers
Mantissa (scale) digits to the right of the decimal point

Oralce provides only one numeric type: number type, and all digital data stored in Oracle can be treated as number type (support binary_float,binary_double after 10g). The following data types are compatible with ANSI SQL:
/**
ANSI SQL: National standardization Organization (ANSI) is an organization that approves multiple industry standards. The standard language used by SQL as a relational database was originally approved in 1986 based on the IBM implementation. In 1987, "International Organization for Standardization (ISO)" used ANSI SQL as an international standard. This standard was revised in 1992 (SQL-92) and revised in 1999 (SQL-99). At present, the newest is SQL-2003.
**/
Float
Numberic
Decimal
Number
Integer
Int
smallint
Double precision
Real

DB2 Database Type

DB2 provides self-built data types and also supports custom types. such as a reference type.

Number Type
smallint 2-byte integer, 5-bit precision, range -32768~32768
Integer 4-byte integers, 10-bit precision, range -2147483648~2147483647
bigint accounts for 8 bytes of stored integers, 19-bit precision, range -9223372036854775808~9223372036854775807
Real single-precision floating-point range -3.402*10^38~-1.175*10^-37 or 1.175*10^-37~3.402*10^38
Double/float double-precision floating-point 64-bit real number, range -1.79769*10^308~-2.225*10^-307 or 2.225*10^-307~1.79769*10^308
Dicimal/nunbric Maximum precision support 31 digits after decimal point

Character type
CHAR fixed length
VARCHAR variable length, maximum 32672 bytes
Long varchar variable length, maximum 32700 bytes
Clob variable length, maximum 2GB bytes

Graphic type (GRAPHIC STRINGS)
A set of byte sequences that are used to render double-byte character data. (binary storage of graphics)
Grahic fixed length
Vargraphic variable length

Binary type
BLOB variable Long binary storage type up to 2GB bytes
LOBs large Object storage type, BLOB,CLOB,DBCLOB and other types collectively known as

Date/Time Type
Date type, consisting of three parts, date and year, range 0001~9999
Time type, hours/minute/second
Timestamp time type, 7 components (year,month,day,hour,minute,second,microsecend)

Datalink Database Reference types

XML data type, DB2 an internal representation of XML. Can only be entered as a function

User-defined Types
Difference type
eg.
Create distinct type AUDIO as BLB (1m). Use AUDIOB to represent a blob (1M) of this data type

Structure type
1 Type a directly uses type B
2.type a directyly uses some type C,and C indrectly uses type B

A reference type is used in conjunction with a struct type to reference a common representation type for a base data type.

MySQL database (collation and network details, the situation can be read the relevant manual)
Data type
1. Integral type (xxxint)
MySQL data type meaning
tinyint (m) 1 byte representation ( -128~127)
smallint (m) 2 byte representation ( -32768~32767)
Mediumint (m) 3 byte representation ( -8388608~8388607)
Int (m) 4 byte representation ( -2147483648~2147483647)
BigInt (m) 8-byte representation (+-9.22*10 18-Time Square)
Divided into
Signen: A character integer that stores positive and negative numbers, such as TINYINT signed represents a range of 127 to 128
UNSIGNED: An unsigned integer that can store only positive numbers, but represents twice times the value of a character integer, such as TINYINT UNSIGNED represents a range of 0 to 255
The difference between a character integer and an unsigned integer only represents the size of the value, and the storage space and efficiency are the same

2. Floating-point (float and double) MySQL data type meaning
float (m,d) single-precision floating-point, 8-bit precision (4 bytes), M is the total number of decimal digits, and
D is the number of digits after the decimal point.
Double (m,d) dual-precision floating-point, 16-bit precision (8 bytes)
3. Fixed-point (decimal)
Decimal (m,d) fixed-point type
floating-point type holds an approximate value in the database, while the fixed-point type holds the exact value in the database. The parameter m is the maximum number (precision) of a fixed-point type number with a range of 0~65,d digits to the right of the decimal point and a range of 0~30, but not more than M.
The calculation of the fixed-point number is accurate to 65 digits.
4. String (char,varchar,xxxtext)
char (n) fixed-length string with a maximum of 255 characters
varchar (n) fixed-length string, up to 65,535 characters
Tinytext Variable-length string, up to 255 characters
Text variable-length string, maximum 65,535 characters
Mediumtext variable-length string, up to 2 24-square-1-character
Longtext variable-length string, up to 2-32-character

5. Date Time Type (date,time,datetime,timestamp)
Date date ' 2008-12-2 '
Time ' 12:25:36 '
DateTime date Time ' 2008-12-2 The only difference between the 22:06:44 '
Timestamp
6.BLOB and the text
Blob and text is that the BLOB holds the binary type and does not have a character set collation, while text saves the character text and has character sets and collations
Their collation is sorted by the first number of characters of the max_short_length length
bit set data type
7. Bit set
bit: max. A bit, typically used to hold a true/false value, such as bit (1), 1 bit, Far less than the use of characters for
SET: To hold multiple true/false values for permission management, see
8. Enumeration
Enum: Similar to SET, but can only insert 1 values, can be used to represent the gender and other unique and range fixed properties (male, female ...)

SQL SERVER database

Bit 0 or 1 integer number
int from -2^31 (-2,147,483,648) to 2^31 (2,147,483,647) integer number

smallint from -2^15 (-32,768) to 2^15 ( 32,767) integer number

tinyint integer number from 0 to 255
decimal from -10^38 to 10^38-1 number of fixed and significant digits

synonyms for numeric decimal
Money data from -2^63 ( -922,337,203,685,477.5808) to 2^63-1 (922,337,203,685,477.5807), minimum currency unit 10 per thousand

SmallMoney from-214 , 748.3648 to 214,748.3647 currency data, minimum currency unit 10 per thousand
float from -1.79E+308 to 1.79E+308 variable precision numbers

Real from -3.04E+38 to 3.04e+ 38 Variable Precision number
datetime from January 1, 1753 to 9999 12th 31 date and time data, minimum time unit is 3% seconds or 3.33 milliseconds

smalldatetime Date and time data from January 1, 1900 to June 6, 2079, minimum time in minutes
Timestam timestamp, unique number for a database width

uniqueidentifier global Unique identifier GUID

Char fixed length non-Unicode character data with a maximum length of 8000

varchar variable length non-Unicode character data with a maximum length of 8000

Text variable length non-Unicode character data with a maximum length of 2^ 31-1 (2G)
nchar character data with a fixed length of Unicode, a maximum length of 8000
nvarchar variable-length Unicode character data, a maximum length of 8000

Ntexz variable-length Unicode character data, The maximum length is 2^31-1 (2G)

Binary fixed length binary data, the maximum length is 8000
varbinary variable length binary data, the maximum length is 8000

Image variable length binary data, the maximum length is 2^31-1 ( 2G)

Oracle Database type

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.