| Home > Computer & I'net > MySQL Database Data Types... |
|
|
|||||||||||||||
|
|
|||||||||||||||
|
||||||||||||||||
MySQL Database Data Types | |||||||||||||||||||||||||||||||||||||||||||||||
TEXT TYPES
The ( ) brackets allow you to enter a maximum number of characters will be used in the column. VARCHAR(20) CHAR and VARCHAR are the most widely used types. CHAR is a fixed length string and is mainly used when the data is not going to vary much in it's length. VARCHAR is a variable length string and is mainly used when the data may vary in length. CHAR may be faster for the database to process considering the fields stay the same length down the column. VARCHAR may be a bit slower as it calculates each field down the column, but it saves on memory space. Which one to ultimatly use is up to you. Using both a CHAR and VARCHAR option in the same table, MySQL will automatically change the CHAR into VARCHAR for compatability reasons. BLOB stands for Binary Large OBject. Both TEXT and BLOB are variable length types that store large amounts of data. They are similar to a larger version of VARCHAR. These types can store a large piece of data information, but they are also processed much slower. NUMBER TYPES
The integer types have an extra option called UNSIGNED. Normally, the integer goes from an negative to positive value. Using an UNSIGNED command will move that range up so it starts at zero instead of a negative number. DATE TYPES
MISC TYPES
ENUM is short for ENUMERATED list. This column can only store one of the values that are declared in the specified list contained in the ( ) brackets. ENUM('y','n')
You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. ----------------- Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission. | |||||||||||||||||||||||||||||||||||||||||||||||
| Articles |
•Auto & Trucks•Business•Computer & I'net·General·Apache·CSS·Database·Hardware·HTML·Javascript&DHTML·LinuxMySQL·Operating System·Perl / CGI·PHP·Programming·Publishing·Search Engines·Software Problems·SSI·Tips & Tricks·Utilities·Web Design•Family•Food & Drink•Gardening•Health•Other•Pets•Psychology•Spiritual•Travel•Women |
| Calculators |
|