Adding a New Table to an Existing Database

Example

Adding a table to an existing database.

MGI Tags

  • mgiEditDatabase

Steps

  1. View the database field administration page in a browser.
  2. Select the database file.
  3. Enter the name of a new database table.
  4. Add fields to the new table.


Step 1: View the database field administration page in a browser.

View the database field administration page in a browser (a database field administration page contains the mgiEditDatabase tag, modifyTables parameter and modifyFields parameter). The first page of the web-based, administration interface is displayed.

Step 2: Select the database file.

All databases at the same level of the file structure as the database field administration page are displayed beside radio buttons under the sentence "Select a database". Select the radio button beside the database file where you want to add the table. Click the "Select Database" button to view the existing tables in the database file.

Step 3: Enter the name of a new database table.

Select the radio button under the sentence "Or, enter the name for a new table (if it doesn't exist, it will be created):". In the text field, enter the name of a new database table (table names are case-sensitive). Click the "Select Table" button to create the new database table and proceed to the next screen of the administration interface. The new database table is created within the database file you selected in step 2.

Step 4: Add fields to the new table.

After you create the new table, you have the opportunity to create database fields within that table. Database tables are separate entities within the database file, therefore the fields that you create in one table do not affect the fields in another table.
 
Once you have decided which fields to include in the database table, consider the type of information that will be entered in each field. An MGI database field can contain the following types of information:
  • Whole Number (Integer): a whole number field can contain only whole numbers without decimals such as years, quantities, etc.
  • Decimal Number (Floating Point Number): a decimal number field can contain decimal numbers such as prices, weights, tax rates, percents, etc.
  • True/False (Boolean): a field containing the values "True" or "False" to discriminate records.
  • Short Text: a short text field can contain up to 250 alpha-numeric characters.
  • Long Text: a long text field can contain text that is greater than 250 alpha-numeric characters.
 
Finally, consider which fields may be used to order database search results. Products can be displayed in the order of entry (default), ascending order (A to Z and smallest to largest), or descending order (Z to A and largest to smallest). Any field that you may want to use for ordering search results must be indexed when you create the field.
 
To create a field, enter the case-sensitive field name in the area labeled "Name". Select a field type from the pop-up menu labeled "Type". Select "True" beside the "Indexed" label if the field will be used to order database search results. Select "False" beside the "Indexed" label if the field will not be used to order database search results. Click the "Add Field" button to add the field to the new database table. Fields are listed in the order they are created below the new field interface.


[Return to the Creating Databases Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]