Skip to main content

Introduction to Five's Tables

Last updated 22/02/2022

Overview to Five's Tables

Tables contain all the data in a database. In tables, data is logically organized in columns and rows. Each row represents a record that is uniquely identified by a primary key, and each column represents a field in the record. Columns define the data in a table and each column holds a single type of data value to further describe the information it contains along with the constraints for the type of data that may be inserted in the column. Each field in a row is implicitly correlated with each of the other fields in that same row. For example, a table containing customer information data might contain a row for each customer and columns representing customer information such as Customer Number, Name, Phone, Mobile, Email.


Customer Table
Figure 1 - Customer table

In Five, you can assign properties to a table, and each field in the table to control the data that is allowed. For example, you can create constraints on a field to disallow null values, or provide a default value, or assign a key constraint on a field that enforces uniqueness or defines a relationship between tables.

Before you can begin to build forms and execute queries on the data in your database, you will need to establish your tables to store the data, Five has been configured to give the assistance to aid the creation of your tables and conventions to avoid ambiguity.

Creating Relationships

Relationships can be created between tables when they have a matching field, that is, the fields in each table hold similar data. As an example, you have a Customer table and you want to link that to an Invoice table. The Customer table would be linked by creating a foreign key that could then be linked to the primary key field in the Invoice table. You may now retrieve the data from both tables because they are linked.

Linking Tables
Figure 2 - Linking Tables

Query Tables

With a good database structure, queries can be applied to filter the table's data so that you only get the information you want.

How Five Will Use Your Tables

The web-forms you develop are only capable of instructing the browser on the method of presenting the information. Five handles the transactions needed to store the information in your database. The input values in your application will be accepted by Five and stored in an organized structure in your tables.

The fields in your tables will become your form fields on your forms and column headings for your lists. The input values must match the definitions set for the values to be stored in your tables.