GoalDescribe tables, records and fields, and choose the fields a database needs for a purpose.
New words
database · an organised store of data that can be searched and sortedrecord · one row of a table: all the data about one thingfield · one column of a table: one kind of data about every recorddata type · the kind of data in a field, such as text, whole number or yes/no
Explanation
A database is a way to store organised data so that we can search it. A database table has rows and columns. Each row is a record, which holds everything about one thing, such as one animal in a rescue centre. Each column is a field, with a field heading that says what it holds, such as Name or Age. A database models a situation by choosing which fields to keep. The fields you choose depend on the job the model must do. Keep only the fields you really need, because the less private data you store, the safer it is. Real people’s details need permission and protection, so practise with invented records.
Name
Species
Age
Vaccinated
Mango
cat
3
yes
Pepper
dog
5
no
Bean
rabbit
1
yes
Worked examples
Job
Fields that are needed
a poster for adoption day
Name, Species, Age, Friendly with children
checking health
Name, Vaccinated, Date of last vet visit, Weight
Different jobs need different fields. The same rescue centre could build two models.
Field
Data type
Example
Name
text
Mango
Age
whole number (integer)
3
Weight in kg
real number
4.5
Vaccinated
yes/no (Boolean)
yes
Each field holds one data type. Choosing the type helps the database to check what is typed in.
Task
Better tool
Why
adding up costs and trying “what if?” prices
spreadsheet
formulae recalculate by themselves
storing hundreds of records and finding the dogs under two years old
database
searching and sorting records is its main job
A spreadsheet and a database both hold tables, but they are better at different jobs.
Class activity
Record cards (no computer): use eight index cards or paper squares. Each card is one record of a toy, with the fields Name, Colour, Size (small, medium or large) and Favourite (yes or no). Make up the data. Then ask the database questions by sorting: all the red toys, all the large toys, the favourites. Lay the matching cards in a pile each time. Which questions were easy? Which field would you add to answer “which toys are soft?” Use only made-up data about toys, never real people.
Practice
1
Look at the table. How many records and how many fields does it have? Which field holds numbers?
Seed
Colour
Days to sprout
bean
brown
6
sunflower
black
10
pea
green
7
radish
red
4
There are 4 records (rows) and 3 fields (columns). The field Days to sprout holds numbers.
2
A zoo wants a database to plan the feeding of its animals. Suggest four fields and a data type for each.
For example: Animal name (text), Species (text), Food per day in kg (real number), Number of meals (whole number), Eats meat (yes/no). Any four sensible fields with suitable types.
3
A school chess club makes a database of members. Which of these fields should NOT be stored, and why? Name, Year group, Home address, Favourite opening.
Home address should not be stored: the club does not need it, and private data needs permission and protection. The fewer private details we store, the safer they are.
4
In the table, one value is in the wrong form for its field. Which, and what should it be?
Name
Age
Member
Omar
11
yes
Tia
ten
yes
Ana
12
no
Tia’s age is typed as the word ten. The Age field should hold a whole number, so it should be 10.