Data Types in the database

Source: Internet
Author: User
Tags integer numbers

There are usually many data types in the database and different classification methods. For example, the most common numeric, numeric, and datetime types are also uncommon Boolean, enumeration, and set types. To support a specific data type (such as the simplest INTEGER) in DBMS, we can consider the following aspects. 1. Data Type name the data type name can appear in DDL statements or metadata returned by INFORMATION_SCHEMA. Some data types also have aliases for various reasons. 2. The value range of the data type is also called the value range. We also need to design the overflow, truncation, rounding and other behaviors of this type of data during computation. 3. Precision and Scale of the Data Type (Precision and Scale) for integer numbers, the Scale is always 0. The Precision can be expressed by binary bit digits or decimal digits. For floating point numbers, it is necessary to determine whether to adopt binary precision, whether to adopt IEEE standard floating point numbers, whether it is single precision or double precision. For exact numbers, the maximum supported precision and scale are also required. For the dense type, the scale is always 0, and the precision usually refers to the number of characters, but also the number of bytes is used systematically. Since it is character type, we have to consider the supported character sets. For the datetime type, the precision refers to the number of digits in seconds after the decimal point. 4. Operations supported on data types, such as addition and subtraction multiplier between INTEGER and other types. 5. Types of indexes supported by data types. For example, many systems do not support creating B + tree indexes for large field types. Generally, spatial indexes are required for spatial data types. 6. Almost all data types can be output in the form of strings. A numeric input can be a numerical constant, a string, or even a binary string or a hexadecimal string. 7. the network transmission format of the data type is the format in which the DBMS Server transfers different data types between the interface and the client. For example, the data type can be a character type or a binary format defined by RPC, or even a customized binary format. 8. Data Type format in memory 9. Data Type format in external storage for simple integer types, the format is mainly a matter of byte order. However, for more complex NUMEIRC types, it is more important to consider the storage and operation efficiency.

Related Article

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.