TAILIEUCHUNG - Học php, mysql và javascript - p 20

Cả hai đều có thể giữ cùng một số giá trị hình ảnh chỉ-một số ký như là nửa chừng chuyển sang bên trái để một nửa giá trị của nó là âm và một nửa là tích cực. Lưu ý rằng các giá trị dấu chấm động (của bất kỳ chính xác) chỉ có thể được ký kết. | one with a possible range from a negative value through zero to a positive one and an unsigned one has a value ranging from zero to a positive one. They can both hold the same number of values just picture a signed number as being shifted halfway to the left so that half its values are negative and half are positive. Note that floating-point values of any precision may only be signed. Table 8-10. MySQL s numeric data types Data type Bytes used Minimum value Signed Unsigned Maximum value Signed Unsigned TINYINT 1 -128 127 0 255 SMALLINT 2 -32768 32767 0 65535 MEDIUMINT 3 -8388608 8388607 0 16777215 INT or INTEGER 4 -2147483648 2147483647 0 4294967295 BIGINT 8 -9223372036854775808 9223372036854775807 0 18446744073709551615 FLOAT 4 38 38 no unsigned no unsigned DOUBLE or REAL 8 308 308 no unsigned no unsigned To specify whether a data type is signed or unsigned use the UNSIGNED qualifier. The following example creates a table called tablename with a field in it called fieldname of the data type UNSIGNED INTEGER CREATE TABLE tablename fieldname INT UNSIGNED When creating a numeric field you can also pass an optional number as a parameter like this CREATE TABLE tablename fieldname INT 4 But you must remember that unlike BINARY and CHAR data types this parameter does not indicate the number of bytes of storage to use. It may seem counterintuitive but what the number actually represents is the display width of the data in the field when it is retrieved. It is commonly used with the ZEROFILL qualifier like this CREATE TABLE tablename fieldname INT 4 ZEROFILL What this does is cause any numbers with a width of less than four characters to be padded with one or more zeros sufficient to make the display width of the field four Accessing MySQL via the Command Line 171 characters long. When a field is already of the specified width or greater no padding takes place. DATE and TIME The main remaining data types .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.