8.3 Creating a database

Two of the common database programs are Microsoft Access and FileMaker Pro. When you create a database the field names are entered followed by the field type that each field will contain, and, for some databases, the field width needs to be set.

The field type indicates the type of data that will be entered into the field. Examples of field types include: text, number, date and calculation. The field width sets how many letters or numbers will be allowed in that field.

In this case, a database will be created for Joe’s Pizza Palaces, which are a chain of pizza cafes owned by Joe Palomari. Each cafe has a manager, cooks, waiting staff and home delivery drivers. The database will allow Joe to maintain his employees’ details.

Databases exercise 1

To revise databases from Book 1, a table will be created, some data entered and edited then a report will be produced.

Creating the database structure

Skills practised
  • Creating a database
  • Adding fields
  • Field types
  • Field widths
  • Entering records
  • Editing data
  • Creating reports
  1. Start your database program and select a NEW (DESKTOP) DATABASE.
  2. Call the file Pizza Palace, set the location to your storage folder and select CREATE or SAVE.
    Note: Database programs usually save the data automatically as you enter it, so you need to save the file first before entering the data.
  3. You can start entering data and field names directly as you did in Book 1, but as databases become more detailed it is normal to enter the field name and field types in a separate section before entering the data.
  4. In Microsoft Access close the provided table, open the CREATE tab in the ribbon and select TABLE DESIGN.
    In FileMaker Pro display the FILE menu, highlight MANAGE and select DATABASE.
  5. 0003.jpg
    Field name Field type
    First Name Short text or text
    Last Name Short text or text
    Birth Date Date and time or date
    Position Short text or text
    Location Short text or text
    Hours Number
    Pay Rate Currency or number
    Enter the following fields and field types. There is no need to enter a Description or Comment.
  6. In FileMaker Pro select OK to complete the table.
  7. TS0801.png
    In Microsoft Access set the DECIMAL places for the PAY RATE field to 2 in the FIELD PROPERTIES pane below the field names so that the currency values are displayed with 2 decimal places.
  8. In Microsoft Access tables must be saved individually. Click on the SAVE icon in the QUICK ACCESS TOOLBAR at the top of the screen, call the table Employees and select OK. Then select YES to the PRIMARY KEY warning.
  9. In Microsoft Access set the VIEW icon to DATASHEET view so that data can be entered.

Entering the data

Enter the following data into the fields, pressing the TAB key after each entry. In some versions of FileMaker Pro, the + icon needs to be clicked to add each new record.

0004.jpg

Creating a report

A report needs to be created to display the data efficiently. If you have forgotten how to create a report, refer to Exercise 5 in the Databases module of Book 1.

  1. In Microsoft Access, click on the REPORT icon in the CREATE tab of the ribbon and save the report under an appropriate name.
  2. In FileMaker Pro set the screen to LAYOUT MODE then select NEW LAYOUT/REPORT from the LAYOUTS menu, select LIST VIEW, give the report a name and select NEXT.
  3. Set the report to list all the fields (except the ID field in Microsoft Access). Add the title ‘Joe’s Pizza Palaces’, the subheading ‘Employee details’ and include the current date.
  4. Adjust the field widths so that the data is displayed neatly.
  5. In FileMaker Pro, format the PAY RATE field to be set to CURRENCY with two decimal places.

Editing the database

  1. Two new employees have been hired. Return to the EMPLOYEES table and add the following records to the database:
    Allison McGowan 8/10/69 Delivery Richmond 35 $10.00
    Peter Van Elden 19/8/88 Cook Richmond 36 $15.00
  2. Sharon Jessop has resigned from the company. Delete her from the database.
  3. The following changes need to be made to the database:
    • Maree Tizard’s hours to 25.
    • Robert Stojanovski has moved to the Keilor cafe.
    • The delivery employees have been granted a pay rise to $11.
Video 8.1 Creating a database (04:14)
×
0004.jpg