Advanced Database – Tables

For this module we are going to create a database for a car repairs garage.

We are going to set up some tables and a form in this section to demonstrate the principles.

3 Tables

First, create a new database in LibreOffice Base called ‘Car Garage’.

Then select tables and click create table in design view.

4 Tables in Design view

Add the fields shown, setting the Car Reg Number field as the primary key by right-clicking on the grey area to the left of the field and selecting primary key.

Save the table, giving it the name ‘Car and owner details’.

5 Table Data View

Open the table and enter some data.

Notice that the account settled field, which was set to ‘Boolean Yes/No’ data type has a checkbox.

6 table Design
7 Table Data View

Create another table with the fields shown, setting ‘Staff Number’ as the primary key.

Populate with similar data to that shown below.

Name the table ‘Mechanics’ and save the data.

8 table Design

Create one more table in design view and add the fields to the left, setting ‘Job No’ as the primary key and selecting ‘Autovalue’ so it automatically creates unique job numbers.

For the ‘Date’ field, in the properties box below, click the … symbol next the Format example box.

This will open a new dialogue box.

9 Field Format

Here you can select from a selection of default formats for entering the date records.

These input formats are known as input masks. We will look at these in more detail later on in this chapter.

For now, select the top format from the list.

Save the table as ‘Jobs’ and close it.

10 Table Data View

Open the table ‘Jobs’ from the main window and enter data.