SQL Workshop - Washington University in St. Louis

嚜燙QL Workshop

?Data

Types

Doug Shook

Data Types

?

Four categories

每 String

每 Numeric

每 Temporal

每 Other

?

26 types total

2

Numeric Types

The integer data types

The decimal data types

Type

bigint

int

smallint

tinyint

bit

Type

decimal[(p[,s])]

numeric[(p[,s])]

money 8

smallmoney

Bytes

8

4

2

1

1

Bytes

5-17

5-17

4

The real data types

Type

float[(n)]

real

Bytes

4 or 8

4

3

Numeric Types

?

Decimal data types include precision and scale

每 Precision: total number of digits

每 Scale: number of digits to the right of decimal

?

Integer and decimal types are exact

每 Real data types include a small amount of error

4

String Types

String data types for storing standard characters

Type

char[(n)]

varchar[(n)]

Bytes

n

String data types for storing Unicode characters

Type

nchar(n)

nvarchar(n)

Bytes

2℅n

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download