SQL Server Data Types Flashcards

(80 cards)

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
REAL Storage Size
4 Bytes
26
REAL Range
-3.40E +38 ≤ r ≤ 3.40E +38
27
REAL Type
Approx.
28
DATETIME Storage Size
8 Bytes
29
DATETIME Range
1753-01-01 ≤ dt ≤ 9999-12-31
30
DATETIME Type
Datetime
31
SMALLDATETIME Storage Size
4 Bytes
32
SMALLDATETIME Range
1900-01-01 ≤ sdt ≤ 2079-12-31
33
SMALLDATETIME Type
Datetime
34
DATE Storage Size
3 Bytes
35
DATE Range
0001-01-01 ≤ d ≤ 9999-12-31
36
DATE Type
Datetime
37
DATETIME2(p) Storage Size
p 1-2 : 6 Bytes p 3-4: 7 Bytes p 5-7: 8 Bytes
38
DATETIME2(p) Range
0001-01-01 ≤ dt2 ≤ 9999-12-31
39
DATETIME2(p) Type
Datetime
40
DATETIMEOFFSET(p) Storage Size
p 1-2 : 8 Bytes p 3-4: 9 Bytes p 5-7: 10 Bytes
41
DATETIMEOFFSET(p) Range
0001-01-01 ≤ dt2 ≤ 9999-12-31
42
DATETIMEOFFSET(p) Type
Datetime
43
CHAR(w) Storage Size
Defined Width
44
CHAR(w) Range
0 ≤ w ≤ 8,000
45
CHAR(w) Type
String
46
VARCHAR(w) Storage Size
2 bytes + w
47
VARCHAR(w) Range
0 ≤ w ≤ 8,000
48
VARCHAR(w) Type
String
49
TEXT(w) Storage Size
4 Bytes + w
50
TEXT(w) Range
0 ≤ w ≤ 2,147,483
51
TEXT(w) Type
String
52
VARCHAR(MAX) Storage Size
2 Bytes + w
53
VARCHAR(MAX) Range
0 ≤ w ≤ 2^31
54
VARCHAR(MAX) Type
String
55
NCHAR(w) Storage Size
Defined width x 2
56
NCHAR(w) Range
0 ≤ w ≤ 4,000
57
NCHAR(w) Type
Unicode
58
NVARCHAR(w) Storage Size
Defined width x 2
59
NVARCHAR(w) Range
0 ≤ w ≤ 4,000
60
NVARCHAR(w) Type
Unicode
61
NTEXT(w) Storage Size
Defined width x 2
62
NTEXT(w) Range
0 ≤ w ≤ 1,073,741,823
63
NTEXT(w) Type
Unicode
64
BINARY Storage Size
?
65
BINARY Range
0 ≤ b ≤ 8,000 bytes
66
BINARY Type
Binary
67
VARBINARY Storage Size
?
68
VARBINARY Range
0 ≤ vb ≤ 8,000 bytes
69
VARBINARY Type
Binary
70
VARBINARY(MAX) Storage Size
?
71
VARBINARY(MAX) Range
0 ≤ vbm ≤ 2^31 bytes
72
VARBINARY(MAX) Type
Binary
73
IMAGE Storage Size
0 ≤ i ≤ 2,147,483,647 bytes
74
IMAGE Type
Binary
75
SQL_VARIANT Type
Other
76
TIMESTAMP Type
Other
77
UNIQUEIDENTIFIER Type
Other
78
XML Type
Other
79
CURSOR Type
Other
80
TABLE Type
Other