Specifications

Numeric Types
The numeric types are either integers or floating point numbers. For the floating point num-
bers, you can specify the number of digits after the decimal place. This is shown in this book
as D. The maximum value you can specify for D is 30 or M-2 (that is, the maximum display
length minus twoone character for a decimal point and one for the integral part of the num-
ber), whichever is lower.
For integer types you can also specify if you want them to be UNSIGNED, as shown in
Listing 8.1.
For all numeric types, you can also specify the
ZEROFILL attribute. When values from a ZERO-
FILL column are displayed, they will be padded with leading zeroes.
The integral types are shown in Table 8.5. Note that the ranges shown in this table show the
signed range on one line and the unsigned range on the next.
TABLE 8.5 Integral Data Types
Storage
Type Range (Bytes) Description
TINYINT[(M)] -127..128 1 Very small integers
or 0..255
SMALLINT[(M)] -32768..32767 2 Small integers
or 0..65535
MEDIUMINT[(M)] -8388608.. 3 Medium-sized integers
8388607
or 0..16777215
INT[(M)] -2
31
..2
31
-1 4 Regular integers
or 0..2
32
-1
INTEGER[(M)] Synonym for INT
BIGINT[(M)] -2
63
..2
63
-1 8 Big integers
or 0..2
64
-1
The floating point types are shown in Table 8.6.
Creating Your Web Database
C
HAPTER 8
8
CREATING YOUR
WEB DATABASE
201
11 7842 CH08 3/6/01 3:38 PM Page 201