ICDL Using Databases study materials
ICDL Using Databases study resources

ICDL Using Databases: Tables

ICDL Using Databases · Work through your exam, one topic at a time.

All guide sections

Tables

Designing a table

Creating a table means naming it, naming each field, and assigning a data type and field properties. Properties you must know: field size (limits text length or number range), format (how a value displays, e.g. currency or date), input mask (controls the pattern typed), default value, validation rule and validation text (the message shown when the rule fails), required (no blank allowed), and indexed (speeds searching/sorting, and can forbid duplicates).

Primary keys and structure

Set a primary key to guarantee uniqueness; a table can have only one primary key, though it may span several fields (a composite key). Know how to insert and delete fields, reorder them, and change a field's data type - remembering that changing type can lose or truncate existing data. Deleting a field deletes its data permanently, so confirm first.

Working in the datasheet

In datasheet view you can resize columns, hide columns, freeze columns, and sort or filter. Formatting a datasheet (fonts, column widths) changes appearance only, not the stored values - a classic trap. Another trap is confusing field size with format: size restricts what can be stored, format only changes display. Also remember that a lookup field can present a list of choices while storing a code.

Rule of thumb

Property = behaviour, format = appearance. If a question asks what stops invalid data being saved, the answer is a validation rule, required setting or data type - never a format or a column width.

Worked example

A Members table needs a membership number of exactly six digits. Set the field to text (to keep leading zeros), field size 6, a validation rule such as Like "[0-9][0-9][0-9][0-9][0-9][0-9]", validation text "Enter six digits", and Required = Yes. Mark it the primary key so no two members share a number.