Database data type

Source: Internet
Author: User

Characters and bytes

ASCII : An English letter (not case) occupies a byte of space, a Chinese character occupies two bytes of space. A binary number sequence, which is used as a digital unit in a computer, typically a 8-bit binary number, converted to decimal. The minimum value is 0, and the maximum value is 255. such as an ASCII code is a byte.

UTF-8 Encoding: An English character equals one byte, and one Chinese (with traditional) equals three bytes. Unicode encoding: one English equals two bytes, one Chinese (including traditional) equals two xBytes. symbols: English punctuation occupies one byte, Chinese punctuation is two bytes. Example: "." 1 bytes in size, Chinese period ". "Takes up 2 bytes in size.between different orders of magnitude

Data storage is represented in 10 binary, data transmission is in 2 binary, so 1KB is not equal to 1000B

1kb=1024b=1024;1mb=1024kb=1024x1024b. where 1024=210. 1B (Byte, byte) = 8 bit (see below) 1KB (Kibibyte, Kbytes) =1024b= 2^10 b;1mb (Mebibyte, MBytes, million-byte, abbreviation "Mega") =1024kb= 2^20 B;1GB (Gigabyte, Gigabyte, 1 billion bytes, also known as "gigabit") =1024mb= 2^30 B;1TB (Terabyte, trillion bytes, MBytes) =1024gb= 2^40 b;1pb (petabyte, petabyte bytes, Pat bytes) =1024tb= 2^50 B; An array of any data type requires 20 bytes of memory space, plus 4 bytes per array dimension, plus the space occupied by the data itself. The amount of memory occupied by the data can be calculated by multiplying the number of data elements by the size of each element. For example, the data in a one-dimensional array consisting of 4 2-byte Integer elements, accounting for 8 bytes. These 8 bytes add an additional 24 bytes, making the total memory space required for this array to be 32 bytes. Related unitsb and BitThe data store is in "byte" (byte) units, the data transfer is based mostly on "bit" (bit, aka "bit") units, a bit represents a 0 or 1 (i.e. binary), every 8 bits (bit, abbreviated to B) constitute a byte (byte, abbreviated to B), is the smallest level of information units. Not to be continued

Database data 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.