AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Models of real life

Week 16 · Unit 7.4: The power of data · 3 lessons
2

Databases as models

Computing 7: Unit 7.4, pp. 112–149
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.

NameSpeciesAgeVaccinated
Mangocat3yes
Pepperdog5no
Beanrabbit1yes
Worked examples
JobFields that are needed
a poster for adoption dayName, Species, Age, Friendly with children
checking healthName, Vaccinated, Date of last vet visit, Weight
Different jobs need different fields. The same rescue centre could build two models.
FieldData typeExample
NametextMango
Agewhole number (integer)3
Weight in kgreal number4.5
Vaccinatedyes/no (Boolean)yes
Each field holds one data type. Choosing the type helps the database to check what is typed in.
TaskBetter toolWhy
adding up costs and trying “what if?” pricesspreadsheetformulae recalculate by themselves
storing hundreds of records and finding the dogs under two years olddatabasesearching 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?
SeedColourDays to sprout
beanbrown6
sunflowerblack10
peagreen7
radishred4
2
A zoo wants a database to plan the feeding of its animals. Suggest four fields and a data type for each.
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.
4
In the table, one value is in the wrong form for its field. Which, and what should it be?
NameAgeMember
Omar11yes
Tiatenyes
Ana12no