Derek Banas - Data Types Intro Flashcards
Numeric Data Types
- TINYINT
- SMALLINT
- MEDIUMINT
- INT
- BIGIN
- BOOL
- FLOAT
- DECIMAL
Date and Time Data Types
- DATE
- DATETIME
- TIMESTAMP
- TIME
- YEAR
String Data Types
- VARCHAR
- BLOB
- MEDIUMBLOB
- LONGBLOB
- ENUM
- SET
Limits of TINYINT
From: -127
To: 127
Storage: 1 byte
Limits of SMALLINT
From: -2^15 (-32,768)
To: 2^15 - 1 (32,767)
Storage: 2 bytes
Limits of MEDIUMINT
From: -2^23 (-8,388,608)
To: 2^23 - 1 (8,388,607)
Storage: 3 bytes
Limits of INT
From: -2^31 (-2,147,483,648)
To: 2^31 - 1 (2,147,483,647)
Storage: 4 bytes
Limits of BIGINT
From: -2^63 (-9,223,372,036,854,775,808)
To: 2^63 - 1 (9,223,372,036,854,775,807)
Storage: 8 bytes
Limits of BOOL
0 OR 1
Definition of FLOAT(size, d)
A floating point number (has a decimal point). The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter.
Definition of DECIMAL(size, d)
An exact fixed-point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. The maximum number for size is 65. The maximum number for d is 30. The default value for size is 10. The default value for d is 0.
Limit of TIME
Max 838:59:59.000000
Limit of YEAR
1901 - 2155
Definition of BLOB
For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data.
Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob. Database support for blobs is not universal.
Definition of ENUM
A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them