Changes

Creating New Databases and Tables with MySQL Administrator

874 bytes added, 20:06, 27 September 2007
Creating New Tables
[[image: mysql_admin_table_editor.jpg]]
 
Begin by entering the name of the table (which we will call ''customer'') in the ''Table name:'' field and, optionally, a comment to describe the purpose of the table. The next task is to begin adding columns.
 
To add a column, click on the diamond icon in the ''Column Name'' column of the table so that the various fields in the ''Column Details'' area of the screen enable. Enter ''customer_id'' as the name of the first column. Select ''Numeric'' from the ''Data Type'' drop down menu. The customer ID will be our primary key (see [[Database Basics]] for a description of primary keys) and will also automatically generated for us as rows are added to the database. Enter 0 as the default value and select the ''Primary Key'' and ''Auto Increment'' check boxes. When completed the ''Column Details'' should appear as follows:
 
[[image: mysql_admin_column_details.jpg]]