Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

OpenOffice 3.x Getting Started Guide
Previous Page Home Next Page

Creating tables in Design View

Design View is a more advanced method for creating a new table. It allows you to directly enter information about each field in the table. We will use this method for the tables of our database.

Image:documentation_note.pngWhile the Field type and formatting are different in Design View, the concepts are the same as in the Wizard.

The first table to be created is Fuel. Its fields are FuelID, Date, FuelCost, FuelQuantity, Odometer, and PaymentType. FuelCost uses currency and two decimal places. FuelQuantity and Odometer use the number format with 3 decimal places and 1 decimal place respectively. PaymentType uses the text format.

  1. Click Create Table in Design View.
  2. FuelID entries:
    1. Enter FuelID as the first Field Name.
    2. Select Integer [INTEGER] as the Field Type from the dropdown list. (The default setting is Text[VARCHAR].)
    3. Image:Tip.pngShortcut for selecting from the Field Type dropdown list: use the key for the first letter of the choice. This might require using the letter more than once to get the choice you want. You can cycle through the choices for a given letter by repeatedly using that letter. After typing the name of the field in the Fields column, use the Tab key to move to the Field Type column. This will enter the field name and highlight the dropdown list. You can then use the key for the first letter of your choice to select the field type. Just remember to use it the correct number of times if necessary.
    4. Change the Field Properties in the bottom section. Change AutoValue from No to Yes.
    5. Field Properties section (AutoValue).
    6. Set FuelID as the Primary key. Right-click on the green triangle to the left of FuelID.
    7. Primary key field.

      Click Primary Key in the context menu. This places a key icon in front of FuelID.

    Image:documentation_note.pngThe primary key serves only one purpose. Any name can be used for this field. It is not necessary to use FuelID as the name of the primary key field. We have used it so we know to which table it belongs by its name.
  3. All other entries:
    1. Enter the next field name in the first column (Field Name column).
    2. Select the Field Type for each field.
      • For Date use Date [DATE]. (Use the D key once to select it.)
      • PaymentType uses Text [VARCHAR], the default setting.
      • All other fields use Number [NUMERIC]. (Use the N key once to select it.)
    3. Select the Field Properties.
    4. Field Properties section.
      • FuelCost, FuelQuantity, and Odometer need changes in the Field Properties section.
        • FuelQuantity: Change Length to 6 and Decimal places to 3. (Many fuel pumps measure fuel to thousands of a gallon in the USA where I live.)
        • Odometer: Change the Length to 10 and the Decimal places to 1.
        • FuelCost: Change the Length to 5 and Decimal places to 2. Click the Format example button. This opens the Field Format window.
        • Field Format options.
      • Use Currency as the Category and your currency as the Format. My currency has two decimal places. Use what is appropriate for your currency.
  4. Repeat these steps for each field in the table. To access additional formatting options, click the button to the right of the Format example panel (Format example button).
  5. Description can be anything, or can be left blank. (The figure below is an example of this.)
  6. To save and close the table, select File > Close. Name the table Fuel.
  7. Example of Description entries.

Follow the same steps to create the Vacations table. The fields and their field types are listed in Figure 9. Make sure you make Date field the primary key before closing. (Right click the Grey box to the left of Date. Select Primary key from the context menu.) Name the table Vacations, and save it.

Top of page


OpenOffice 3.x Getting Started Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Creative Commons License Design by Interspire