Databases

Unit 1: Introducing the Database

Lesson 2: Creating a Database Table


How do you add a field to a table?
How do you delete a field from a table?

It can happen that even after the most careful planning, you realize you need to add or delete a field from a table you have defined. Be forewarned, though, that if your table has existing data, or your database has other objects defined, you may have additional work beyond the mechanical process of adding or deleting a field.

If you add a field to a table with existing records, you may need to update these existing records with a value for the new field. If you delete a field from a table that is referenced in other objects defined in your database (forms, reports, etc.), you will need to edit the other objects and remove the references to the deleted field.

The tight coupling between the objects in your database is both a blessing and a curse. The tight coupling enables the efficient storage and retrieval of data, but also makes it hard to change the structure of the database once it has been defined. It is for this reason that we stress the importance of planning and design when you are creating a new database.

Adding and deleting a field

In the above animation we add a field for the ISBN number of the book and delete the field Price. Since we are changing the structure of the database (and not the data within the database), we make the changes in Design view. We insert and delete a field using the toolbar buttons . We could have also used the menu commands Insert/Field and Edit/Delete Row.

How do you reposition a field in a table?

There is usually a natural order to the fields in a table. For example, First Name is next to Last Name. The order of fields listed in Datasheet view is the same as the order of fields in Design view.

The following animation shows how to move a field in Design view.

Moving a field

Note: In the above animation, the field is moved by first selecting the field and then clicking and dragging the field to a new location. Selecting and dragging in one step will highlight or select multiple fields.

Previous Next


Copyright 1997 by the Curators of the University of Missouri