GoalExplain what a data table is and tell rows from columns, records from fields.
New words
data table · the place where a database keeps its data, made of rows and columnsrecord (row) · one row of a table: all the data about one thingfield (column) · one column of a table: one kind of data about every recordcell · the box where one row and one column meet
Explanation
A data table is the basic building block of a database. It is the only place inside the database where the data is kept. A table is made of rows and columns. Each row is one record: it holds all the data about one thing, for example one pupil. Each column is one field: it holds one kind of data about every record, for example the name or one subject’s mark. The box where a row and a column meet is a cell, and it holds one single value. Look at the table of marks below. It is a table called “Student results”, and its numbers are invented, with marks out of 20. It has five fields (id, name and three marks) and five records, one for each pupil. To find Pupil 3’s English mark, find the row of Pupil 3, then follow it to the English column: the cell says 12.
A
B
C
D
E
1
id
Name
Arabic
English
Computer
2
1
Pupil 1
18
15
19
3
2
Pupil 2
14
17
16
4
3
Pupil 3
20
12
18
5
4
Pupil 4
16
19
15
6
5
Pupil 5
12
14
20
Worked examples
A
B
C
D
E
1
id
Name
Arabic
English
Computer
2
1
Pupil 1
18
15
19
3
2
Pupil 2
14
17
16
4
3
Pupil 3
20
12
18
5
4
Pupil 4
16
19
15
6
5
Pupil 5
12
14
20
Count the records in the table of marks. Each pupil is one row, so there are 5 records. Count the fields: id, name, Arabic, English and Computer, so there are 5 fields.
A
B
C
D
E
1
id
Name
Arabic
English
Computer
2
1
Pupil 1
18
15
19
3
2
Pupil 2
14
17
16
4
3
Pupil 3
20
12
18
5
4
Pupil 4
16
19
15
6
5
Pupil 5
12
14
20
Pupil 2 got 14 in Arabic, 17 in English and 16 in Computer. Add the cells of that record: 14 + 17 + 16 = 47. The sum belongs to one record, so we read along one row.
A
B
C
D
E
1
id
Name
Arabic
English
Computer
2
1
Pupil 1
18
15
19
3
2
Pupil 2
14
17
16
4
3
Pupil 3
20
12
18
5
4
Pupil 4
16
19
15
6
5
Pupil 5
12
14
20
Which pupil got the highest mark in Computer? Look down one field, the Computer column, and compare its cells: 19, 16, 18, 15, 20. The highest is 20, in the record of Pupil 5.
Class activity
Make a table on paper for six invented classmates with the fields “id”, “name” and “favourite subject”. Draw the grid with a ruler. Colour one record in yellow and one field in blue. Ask a partner: How many records? How many fields? What is in the cell where row 3 meets the third column?
Practice
1
In a table, what is a record and what is a field?
A record is a row; a field is a column.
2
In the table of marks, which mark did Pupil 4 get in English?