Sorting a Table

Whilst it is convenient to enter records in any particular order it is necessary to have output listings in some sort of order eg. ascending price order, alphabetical vendor, order, etc. The ID field is declared to be a key field for the Property table. Each ID value is declared to be unique and the records are displayed in ascending ID order.

Return to the Table function by clicking on its tab. Select the Property table and call up it's design and you will see a key icon next to the ID field. Every table needs a key field and records are displayed in order of this key field.

The Property table only requires one key field since each house has a unique ID number but some databases allow multiple occurrences of a key field value and require other key fields - eg. an electoral list has a road and house number followed by the residents in surname and forename order. The four fields are key fields since their values determine their position in a list. The first key field is called the primary, followed by the secondary, etc.

A table can temporarily be sorted into a different order by selecting a column, say the Type column, and choosing Records/Sort/Sort Ascending from the Menu Bar, or click on the sort icon (illustrated above). Closing the table will cause the ordering to revert to the key field.

Contents: Databases

Skill Check: Databases