tailieunhanh - Mysql your visual blueprint for creating open source databases- P4

Mysql your visual blueprint for creating open source databases- P4:The show tables command displays a list of tables available in the currently selected database. You can use this command when you are unsure of the exact name of a table within the database. | 2 MANAGE DATABASES AND TABLES If you are not sure what length to use for a CHAR or VARCHAR column specify a value large enough to store a typical value. You can always change the length later. You can also change VARCHAR columns to TEXT columns without losing data. This is explained in Chapter 3. The MySQL server may automatically change the type of some of your columns if there is a conflict between them. In particular if you use fixed-length CHAR columns and at least one variable-length VARCHAR or TEXT column the entire row must be variable length so your CHAR columns are converted to VARCHAR. In addition the server automatically changes VARCHAR columns with a length of one to three characters to CHAR columns because it is not practical to use variable length when the column is this small. While it is important to choose the correct column types when you create a table after you have created it you can work with VARCHAR and CHAR columns in exactly the same ways. TEXT columns also work in most of the same ways except that you cannot use the entire body of a TEXT field as an index. The MySQL monitor prompts for another line. LQ Type url VARCHAR 255 and press Enter. Q Type description TEXT and press Enter. Note If you want to add additional fields include them before the closing parenthesis. The table is now created. L-0 To verify that the command worked type SHOW COLUMNS FROM links and press Enter. The columns you created for this table are displayed. 47 IIS MySQL USING SETS AND ENUMERATIONS Sets and enumerations are different from normal text columns in that they are limited to a specific list of values. You can use these columns whenever you need to assign categories to the items in a table. For example suppose you were using a database table to catalog music recordings. You could use a SET column to store the category of music that each recording contains category SET rock pop blues country dance The one potential disadvantage of a SET column is that each item .