Tables, Records, Fields & Keys Flashcards

All 8 cards in this deck

In a database, what is a table?

A collection of records about one kind of thing, e.g. customers, set out in rows and columns.

In a database table, what is a record?

All of the data stored about one item, e.g. one customer. It is one row of the table.

In a database table, what is a field?

One item of data stored about every record, e.g. Surname. It is one column of the table.

What is a primary key?

A field whose value uniquely identifies each record in a table, so no two records can have the same value.

What is a foreign key?

A field in one table that is the primary key of another table. It links the two tables together.

Why is a Surname field usually unsuitable as a primary key?

Two records could have the same surname, so it would not uniquely identify each record. An ID field, e.g. CustomerID, is added instead.

What does a field's data type set in a database table?

The kind of value every entry in that field can hold, e.g. integer, real, Boolean or string. A price field should be real, not integer or string.

Can the same foreign key value appear in more than one record of a table?

Yes. A primary key value must be unique in its own table, but a foreign key value can repeat, e.g. one CustomerID on many records in an Order table, because one customer can place many orders.