SQL Server Data Types Flashcards

1
Q

BIGINT Storage Size

A

8 Bytes

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

BIGINT Range

A

-2^63 ≤ bi ≤ 2^62

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

BIGINT Type

A

Exact

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

INT Storage Size

A

4 Bytes

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

INT Range

A

-2,147,483,648 ≤ int ≤ 2,147,483,647

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

INT Type

A

Exact

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

TINYINT Storage Size

A

1 Byte

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

TINYINT Range

A

0 ≤ ti ≤ 255

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

TINYINT Type

A

Exact

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

BIT Range

A

0 to 1

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

BIT Storage Size

A

1 - 8 BIT cols in same tbl = 1 byte
9-16 BIT cols in same tbl = 2 byte
etc…

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

BIT Type

A

Exact

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

NUMERIC(p,s) / DECIMAL(p,s) Storage Size
p = precision
s = scale

A

p 1-9 = 5 bytes
p 10-19 = 9 bytes
p 20-28 = 13 bytes
p 29-38 = 17 bytes

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

NUMERIC(p,s) / DECIMAL(p,s) Range

A

-10^38 ≤ n ≤ 10^37

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

NUMERIC(p,s) / DECIMAL(p,s) Type

A

Exact

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

MONEY Storage Size

A

8 Bytes

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

MONEY Range

A

-2^59 ≤ m ≤ 2^58

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

MONEY Type

A

Exact

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

SMALLMONEY Storage Size

A

4 Bytes

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

SMALLMONEY Range

A

-214,748.3648 ≤ sm ≤ 214,748.3647

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

SMALLMONEY Type

A

Exact

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

FLOAT Storage Size

A

00 ≤ p ≤ 24 : 4 Bytes

25 ≤ p ≤ 53 : 8 Bytes

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

FLOAT Range

A

-1.79E +308 ≤ f ≤ 1.79E +308

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

FLOAT Type

A

Approx.

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

REAL Storage Size

A

4 Bytes

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

REAL Range

A

-3.40E +38 ≤ r ≤ 3.40E +38

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

REAL Type

A

Approx.

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

DATETIME Storage Size

A

8 Bytes

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

DATETIME Range

A

1753-01-01 ≤ dt ≤ 9999-12-31

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

DATETIME Type

A

Datetime

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

SMALLDATETIME Storage Size

A

4 Bytes

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

SMALLDATETIME Range

A

1900-01-01 ≤ sdt ≤ 2079-12-31

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

SMALLDATETIME Type

A

Datetime

34
Q

DATE Storage Size

A

3 Bytes

35
Q

DATE Range

A

0001-01-01 ≤ d ≤ 9999-12-31

36
Q

DATE Type

A

Datetime

37
Q

DATETIME2(p) Storage Size

A

p 1-2 : 6 Bytes
p 3-4: 7 Bytes
p 5-7: 8 Bytes

38
Q

DATETIME2(p) Range

A

0001-01-01 ≤ dt2 ≤ 9999-12-31

39
Q

DATETIME2(p) Type

A

Datetime

40
Q

DATETIMEOFFSET(p) Storage Size

A

p 1-2 : 8 Bytes
p 3-4: 9 Bytes
p 5-7: 10 Bytes

41
Q

DATETIMEOFFSET(p) Range

A

0001-01-01 ≤ dt2 ≤ 9999-12-31

42
Q

DATETIMEOFFSET(p) Type

A

Datetime

43
Q

CHAR(w) Storage Size

A

Defined Width

44
Q

CHAR(w) Range

A

0 ≤ w ≤ 8,000

45
Q

CHAR(w) Type

A

String

46
Q

VARCHAR(w) Storage Size

A

2 bytes + w

47
Q

VARCHAR(w) Range

A

0 ≤ w ≤ 8,000

48
Q

VARCHAR(w) Type

A

String

49
Q

TEXT(w) Storage Size

A

4 Bytes + w

50
Q

TEXT(w) Range

A

0 ≤ w ≤ 2,147,483

51
Q

TEXT(w) Type

A

String

52
Q

VARCHAR(MAX) Storage Size

A

2 Bytes + w

53
Q

VARCHAR(MAX) Range

A

0 ≤ w ≤ 2^31

54
Q

VARCHAR(MAX) Type

A

String

55
Q

NCHAR(w) Storage Size

A

Defined width x 2

56
Q

NCHAR(w) Range

A

0 ≤ w ≤ 4,000

57
Q

NCHAR(w) Type

A

Unicode

58
Q

NVARCHAR(w) Storage Size

A

Defined width x 2

59
Q

NVARCHAR(w) Range

A

0 ≤ w ≤ 4,000

60
Q

NVARCHAR(w) Type

A

Unicode

61
Q

NTEXT(w) Storage Size

A

Defined width x 2

62
Q

NTEXT(w) Range

A

0 ≤ w ≤ 1,073,741,823

63
Q

NTEXT(w) Type

A

Unicode

64
Q

BINARY Storage Size

A

?

65
Q

BINARY Range

A

0 ≤ b ≤ 8,000 bytes

66
Q

BINARY Type

A

Binary

67
Q

VARBINARY Storage Size

A

?

68
Q

VARBINARY Range

A

0 ≤ vb ≤ 8,000 bytes

69
Q

VARBINARY Type

A

Binary

70
Q

VARBINARY(MAX) Storage Size

A

?

71
Q

VARBINARY(MAX) Range

A

0 ≤ vbm ≤ 2^31 bytes

72
Q

VARBINARY(MAX) Type

A

Binary

73
Q

IMAGE Storage Size

A

0 ≤ i ≤ 2,147,483,647 bytes

74
Q

IMAGE Type

A

Binary

75
Q

SQL_VARIANT Type

A

Other

76
Q

TIMESTAMP Type

A

Other

77
Q

UNIQUEIDENTIFIER Type

A

Other

78
Q

XML Type

A

Other

79
Q

CURSOR Type

A

Other

80
Q

TABLE Type

A

Other