Compare/contrast fundamental data types/characteristics Flashcards
Char
The CHAR data type stores character data in a fixed-length field. Data can be a string of single-byte or multibyte letters, numbers, and other characters that are supported by the code set of your database locale.
What is the benefit of using char?
Using chars has many advantages: they are light-weight and therefore efficiently use memory, require less processing power than other data types such as strings, can be used to store any language from around the world (using Unicode chars) and can easily be encoded for transmission over networks.
char data type disadvantages
the disadvantage of CHAR is that it can waste a lot of space if the values are much shorter than the fixed length. This can increase the storage cost and reduce the cache efficiency of the database.
what are Strings data type
A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
what is Integers data type
The INTEGER data type stores whole numbers that range from -2,147,483,647 to 2,147,483,647 for 9 or 10 digits of precision. The number 2,147,483,648 is a reserved value and cannot be used. The INTEGER value is stored as a signed binary integer and is typically used to store counts, quantities, and so on.
integer data type benefits
If your data does not have decimal points, use integer types: integer types are much faster and can take much less space in your storage or RAM (while the program is running).
integer data type disadvantage
The disadvantage to using INTEGER and SMALLINT is the limited range of values that they can store. The database server does not store a value that exceeds the capacity of an integer. Of course, such excess is not a problem when you know the maximum and minimum values to be stored.
what is float data type
The FLOAT data type stores double-precision floating-point numbers various length
integer float type disadvantage
Cons: Round-off error and precision issues.
Floats data types advantages
Floating-point numbers have two advantages over integers. First, they can represent values between integers. Second, because of the scaling factor, they can represent a much greater range of values.