Related types are bigint, mediumint,
smallint, and tinyint. A bit data type is able to
store values of 0 and 1.
decimal (M,N) M+2 bytes if N > 0 One character for each digit of the value, the
decimal point (if the scale is greater than 0), and
the negative sign (for negative numbers).
M+1 bytes if N = 0 decimal is a numeric data type you??™ll use to
store monetary information because of its exact
precision. To preserve the decimal precision of
these numbers, MySQL stores decimal values
internally as strings. M represents the precision
(the number of significant decimal digits that
will be stored for values), and N is the scale (the
number of digits after the decimal point). If N is 0,
decimal will only store integer values.
datetime 8 bytes Supports date and time data from
1000-01-01 00:00:00 to 9999-12-31 23:59:59.
varchar variable Stores variable-length character data from 0 to
65,535. The dimension you set represents the
maximum length of strings it can accept.
text (blob) L+2 bytes, where L < 2^16 A column with a maximum length of 65,535
(2^16 ??“ 1) characters.
Keep in mind that data type names are case insensitive, so you might see them capitalized
differently depending on the database console program you??™re using.
Now, let??™s get back to the department table and determine which data types to use. Don??™t
worry that you don??™t have the table yet in your database; you??™ll create it a bit later.
Pages:
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148