How to Create Database Tables Using BASE

A Tutorial for Creating a Table in with OpenOffice.org BASE

© Brendan Vittum

Apr 23, 2009
Figure 1: The Main Database Window., B. W. Vittum
This example shows how to create a simple address book. This database can be created in under ten minutes by a user with little to no experience using OpenOffice.org BASE

Once a database is created in OpenOffice.org BASE, tables need to be created in order to store the data. This example shows how to store a list of names, addresses, and phone numbers; an address book. This is one of the simplest of databases and, using OpenOffice.org BASE, can be created in under ten minutes by a user with little to no experience.

How to Create a Database Table Using BASE:

With the Tables icon highlighted in the left, click Create Table in Design View… on the right hand of the window. In Design view the fields for tables are created manually. [Figure 1]

Each row in this screen [Figure 2] is a field in the database table. Click the Field Name cell and enter names for each data field to create. Using the simple phone book example there will be four rows or fields:

  1. Field Name: Index; Field Type: Integer [INTEGER]*; Description: Primary key for the Database.
  2. Field Name: Name; Field Type: Text [VARCHAR]; Description: Name of the person in the database.
  3. Field Name: Address; Field Type: Text [VARCHAR]; Description: Address of the person in the database.
  4. Field Name: Phone; Field Type: Text [VARCHAR]; Description: Phone Number of the person in the database.

*(Field Types are drop-down selections of all available kinds of information stored in the database. Once a cell for the Field Type is clicked in, an arrow appears, clicking that are will show the drop-down.)

After this data has been entered, a few things should be explained, and done, to finalize the table for data entry..

Setting A Primary Key;

  1. Right click in the box to the left of the Field Name Index and select Primary Key from the context menu,
  2. Set to drop down option in Field Properties for AutoValue to yes. [Figure 3]

A quick note on primary keys. BASE, like most databases, needs a primary key to edit or access table data. A primary key is a unique identifier for each record allowing BASE to know exactly which row to return results from, or effect when the database receives an instruction.

Setting the Field Type to Integer {INTEGER} tells the database to only allow numerical data in this column and setting the AutoValue to yes means the database will generate these numbers, or values, automatically. The is a two-fold benefit here, there is one less piece of data-entry for the user, and it eliminates possible mistakes through gaps or attempted duplicate entries.

Setting A Table Row for Text;

  1. Fields two through four are all set with a Field Type of Text [VARCHAR],
  2. Set the Field Properties in the bottom portion of the screen Length at 255; the maximum number of characters allowed for this Field Type. [Figure 4]
  3. Click File → Save to save the table just created.

At this point the only thing that remains is to start populating the table with data. This could be done through an interface much like the one used to design the table – but a form be much simpler.


The copyright of the article How to Create Database Tables Using BASE in Office/Business Software is owned by Brendan Vittum. Permission to republish How to Create Database Tables Using BASE in print or online must be granted by the author in writing.


Figure 1: The Main Database Window., B. W. Vittum
Figure 2: Fields in the Database Table., B. W. Vittum
Figure 3: Setting A Primary Key., B. W. Vittum
Figure 4: Setting A Table Row for Text;, B. W. Vittum
 


Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo

Comments
Apr 28, 2009 7:09 PM
Guest :
Good article, thanks.
Jul 27, 2009 12:03 PM
Andrew :
Hello all

Just want to let you know about http://mytaskhelper.com - online database application:
- you can create complex web-forms
- you can put this forms to your site, using Widget Builder menu
- you can create file/image/video databases
- again you can integrate Widget-form for adding some records to your site, and another widget for integrating your collected data
- you can add validations, to be sure your users add proper data, for example Email validation, uniqueness etc

for example - you can create form for bug-trucking, with task name/priority, attach screenshot, dates etc,
put it into your site - and you have bug-trucking system for free!
Please, see more on about page.

- And it's all for free

Thanks
2 Comments