Data types Flashcards
(30 cards)
SQL Datatypes (only names)
- Binary datatype
- Numeric datatype
- Exact numeric datatype
- String datatype
- Date Datatype
Further classification of string datatype
UNI string datatype
Binary Data Type (only names)
- Binary
- Varbinary
- Image
Maximum length of Binary - binary datatype
8000 bytes
Important point about binary-binary data type
Fixed length binary data
Maximum length of varbinary
8000 bytes
Important point about varbinary data type
Variable length binary data
maximum length Image datatype
2,147,483,647 bytes
Important point about image data type
Variable length binary data
Another name of image data type
BLOB: Binary Large Objects
Type of Numeric Data Type
Approximate numeric datatype
Exact numeric datatype
Type of approximate numeric data type
Float
Real
Range of Float approximate numeric data type
From -1.79E+308 to 1.79E+308
Description of Float approximate numeric data type (3)
Used for floating point value
Double precision
32 bit space
Range of real approximate numeric data type
From -3.40e+38 to 3.40e+38
Description of Real approximate numeric data type (3)
Single precession floating point value
Used to represent too large number or too small number
16 bit space
Type of Exact Numeric data type
also tell which is integer and which is fraction
also size
- bigint - integer (8 bytes)
- int - integer (4 bytes)
- smallint - inetegr (2 bytes)
- tinyint - integer (1 byte)
- bit - integer (1 bit)
- decimal - fractional and accurate
- numeric - fractional and accurate
- money - fractional and accurate
- smallmoney - fraction and accurate
Difference between Decimal and floating data type
Decimal used to store exact and accurate number.
Floating point number can be rounded.
Description BIGINT
to store large integers
represent in 2’s complement form
Extremely large whole number
used for Primary key if integer data type
More storage space required
Description Decimal
Numeric data with fixed precision and scale
Allowed to specify both precision and scale
Used for exact numeric values
another name - Numeric
Advantages of Decimal
Fixed precision
No rounding error
Data consistency
Description Money
Used for monetary values such as currency
type of Character string datatype
char
varchar
text
maximum length of char data type
maximum 8000 characters