Common MySQL data types. Flashcards

1
Q

Category: Character
Storage: Length of characters + 2 bytes

Notes: Variable-length string with a maximum of 65,535 characters.

A

Data Type: TEXT

Example: ‘string’

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

Category: Character
Storage: Length of characters + 1 byte

Notes: Variable-length string with a maximum of N characters; 0 ≤ N ≤ 65,535

A

Data Type: VARCHAR(N)

Example: ‘string’

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

Category: Character
Storage: N bytes

Notes: Fixed-length string of length N; 0 ≤ N ≤ 255

A

Data Type: CHAR(N)

Example: ‘string’

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

Category: Date and time
Storage: 5 bytes

Notes: Format: YYYY-MM-DD hh:mm:ss; Range: ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’

A

Data Type: DATETIME

Example: ‘1776-07-04 13:45:22’

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

Category: Date and time
Storage: 3 bytes

Notes: Format: hh:mm:ss

A

Data Type: TIME

Example: ‘1776-07-04 13:45:22’

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

Category: Date and time
Storage: 3 bytes

Notes: Format: YYYY-MM-DD; Range: ‘1000-01-01’ to ‘9999-12-31’

A

Data Type: DATE

Example: ‘1776-07-04 13:45:22’

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

Category: Decimal
Storage: 8 bytes

Notes: Approximate decimal numbers with range: -1.8E+308 to 1.8E+308

A

Data Type: DOUBLE

Example: 123.4 and -54.29685

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

Category: Decimal
Storage: 4 bytes

Notes: Approximate decimal numbers with range: -3.4E+38 to 3.4E+38

A

Data Type: FLOAT

Example: 123.4 and -54.29685

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

Category: Decimal
Storage: Varies depending on M and D

Notes: Exact decimal number where M = number of significant digits, D = number of digits after the decimal point

A

Data Type: DECIMAL(M,D)

Example: 123.4 and -54.29685

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

Category: Integer
Storage: 8 bytes

Notes:
Signed range: -2^63 to 2^63 -1;

Unsigned range: 0 to 2^64 -1

A

Data Type: BIGINT

Example: 34 and -739448

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

Category: Integer
Storage: 4 bytes

Notes:
Signed range: -2,147,483,648 to 2,147,483,647;

Unsigned range: 0 to 4,294,967,295

A

Data Type: INTEGER or INT

Example: 34 and -739448

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

Category: Integer
Storage: 3 bytes

Notes: Signed range: -8,388,608 to 8,388,607; Unsigned range: 0 to 16,777,215

A

Data Type: MEDIUMINT

Example: 34 and -739448

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

Category: Integer
Storage: 2 bytes

Notes:
Signed range: -32,768 to 32,767;

Unsigned range: 0 to 65,535

A

Data Type: SMALLINT

Example: 34 and -739448

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

Category: Character
Storage: Length of characters + 2 bytes

Notes:
Variable-length string with a maximum of 65,535 characters.

A

Data Type: TEXT

Example: ‘string’

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