Databases: structure, keys and forms Cambridge IGCSE Information & Communication Technology revision

Not started

Learn it

In plain words

A database is an organised collection of data. Before any data goes in, its structure has to be designed: what tables there are, what fields each has, what type of data each field holds, and how the tables are linked.

7 things to know

  1. A table holds data in records (rows) and fields (columns).
  2. Data types: text (also called alphanumeric), numeric (integer, decimal or currency), date/time, and Boolean (also called logical), which has two values, such as yes and no. A Boolean field can be shown as yes/no, true/false or a checkbox.
  3. A flat file database is a single table. It is simple to set up, but the same data is often repeated in many records, which wastes storage and leads to mistakes when it is changed.
  4. A relational database has two or more tables that are linked. Each item of data is stored once, so there is less duplication, and a change made in one place applies everywhere. It is more complex to design.
  5. A primary key is a field that uniquely identifies each record in a table.
  6. A foreign key is a field in one table that is the primary key of another table. It is what links the two tables.
  7. A good data entry form has a clear title and labels, fields in a logical order, boxes of a suitable size, drop-down lists and tick boxes to reduce typing, clear navigation buttons and enough white space.

Worked example

A library has a Books table (with BookID) and a Loans table that records which book was lent to which member. How are the tables linked?

  1. BookID is the primary key of the Books table: it identifies each book.
  2. The Loans table has a BookID field too. There it is a foreign key.
  3. The foreign key links each loan to one record in the Books table, so the book's details are not repeated in every loan.

Tips and tricks

  • A telephone number is text, not numeric: no arithmetic is done with it, and a leading zero must be kept.
  • Primary key: unique in its own table. Foreign key: a primary key from another table, used as the link.
6 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Databases: structure, keys and forms: 6 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. What is a primary key?
    • the first record in a table
    • a field that uniquely identifies each record (the answer)
    • a password for the database
    • a field that can be left empty

    No two records can share its value.

  2. Which data type suits a field recording whether a fee has been paid?
    • text
    • numeric
    • date/time
    • Boolean (the answer)

    It has two values: yes or no.

  3. Which data type should be used for a telephone number?
    • text (the answer)
    • integer
    • currency
    • Boolean

    Leading zeros would be lost in a numeric field.

  4. What is a flat file database?
    • a database with linked tables
    • a database with a single table (the answer)
    • a database with no fields
    • a database stored on paper

    Data is often repeated in it.

  5. What does a foreign key do?
    • encrypts a table
    • links a table to another table (the answer)
    • sorts the records
    • deletes duplicates

    It holds the primary key of the other table.

  6. Which is a feature of a good data entry form?
    • no labels
    • very small boxes
    • drop-down lists to reduce typing (the answer)
    • fields in a random order

    Choosing from a list prevents spelling errors.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf