Week 5 · Unit 2 Requirements and Production Stages of the Project (2), Create database tables stage (1): database, table, record, field, field types and sizes, flat and relational databases, the primary key · 3 lessons
1
Database, table, record and field
ICT Secondary 2 Term 1, Unit 2, Topic 2: pp. 40–44
GoalTell database, table, record and field apart by reading a small table.
New words
database · an organised store of data about one subjecttable · the main building block of a database, made of records (rows) and fields (columns)record · one row: everything the table knows about one member, case or productfield · one column: a single kind of fact, stored for every record
Explanation
A database is an organised store of data about one subject, kept so that we can find facts and make decisions. A reading club might keep a database about its members and its books. The main building block is the table. Look at the table below. Each row is a record: it holds everything the table knows about one member. Each column is a field: it holds one kind of fact, such as the name, for every record. The head of the table names the fields. This table has four fields and five records. Rows and columns are easy to confuse, so remember: a record goes across, a field goes down. In every record each field holds exactly one fact, so books_read of member 3 is 12 and nothing else.
Table: members
member_no
name
level
books_read
1
Mona
silver
7
2
Omar
starter
2
3
Hana
gold
12
4
Karim
silver
6
5
Salma
starter
1
Worked examples
Question
Answer
How many fields?
4
How many records?
5
Record of member 3
3, Hana, gold, 12
Values of the field level
silver, starter, gold, silver, starter
Read the table: it has four fields (member_no, name, level, books_read) and five records. The record of member 3 is: 3, Hana, gold, 12. The field level holds the values silver, starter, gold, silver, starter.
Part
What it is
the whole row for Omar
record
the column name
field
the word silver
one value of a field
Karim names parts of the table. “The whole row for Omar” is a record. “The column name” is a field. “The word silver” is one value of the field level.
Class activity
Make a table on paper for your own collection: four fields and five records (for example your five favourite games: title, kind, players, score out of 10). Use invented data. Circle one record and underline one field.
Practice
1
In the members table, what is “Hana, gold, 12”?
Part of a record: the facts about member 3 (without her number).
2
How many facts does one field hold in one record?
Exactly one.
3
A record goes across the table. Which goes down: a record or a field?
A field.
4
Name two things a club could keep a database about.