When we want information from a book,
we look in the index to find the relevant page. A database works in
the same way. It sets up at least one main index to work out where
each record can be found. This index is called the primary
key.
Another thing to bear in mind is that each field can be set up
so that only certain types of data can be entered into them. It
could be that you set a field to only accept text or numbers, or
a field could be set to automatically enter either a date or a unique
number as you create the record.
Chris has started work on the membership database. He decides that the
membership number is the number that the database will use as the primary
key to sort out the different records.
He could type in the number manually into a number field, but as this
is the primary key this may make things difficult later - he’d have
to keep track of which number he was up to and might use the same number
by accident.
Instead, he sets the database to automatically increment this number
each time a new record is made. Doing it this way ensures they are unique
and also makes it a little more future proof - other people could add
to the database simultaneously should his business expand.
Chris is now setting the data types on his membership database. There
are several types of information that he needs to store.