Compare/contrast fundamental data types/characteristics Flashcards

1
Q

Char

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the benefit of using char?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

char data type disadvantages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are Strings data type

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is Integers data type

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

integer data type benefits

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

integer data type disadvantage

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is float data type

A

The FLOAT data type stores double-precision floating-point numbers various length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

integer float type disadvantage

A

Cons: Round-off error and precision issues.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Floats data types advantages

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly