Changes

Creating New Databases and Tables with MySQL Administrator

922 bytes added, 20:15, 27 September 2007
Creating New Tables
<tr>
</table>
 
Finally, add another column as follows:
 
<table>
<td><b>Name:</b><td>customer_address</td>
<tr>
<td><b>Data Type:</b><td>TEXT</td>
<tr>
</table>
 
Once these columns are configured, click on the ''Apply Changes'' button to create the table. At this point, it is important to appreciate that all MySQL Administrator is doing is providing a user friendly way to generate and run SQL commands. At this point, therefore, the tool displays the SQL that will be executed to create the table and columns specified. if you are new to SQL take some time to review the SQL commands - these will be covered in more detail later in this book. The SQL commands to create our table should read as follows:
 
<pre>
CREATE TABLE `myDBase`.`customer` (
`customer_id` NUMERIC NOT NULL DEFAULT 0 AUTO_INCREMENT,
`customer_name` TEXT NOT NULL,
`customer_address` TEXT NOT NULL,
PRIMARY KEY (`customer_id`)
)
ENGINE = MyISAM;
</pre>