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

Rules, forms and projects

Week 20 · 2.2 Data and databases · 3 lessons
3

Project: seed swap

Computing 8: Topic 2.2, pp. 212–229
GoalDesign, test and evaluate a small database on paper, for a purpose you choose.
New words
purpose · what the database is forevaluate · to judge how well a database does its job and say what to improveoptional field · a field the user may leave empty, so it has no presence check
Explanation

This lesson is a project: design a small database on paper. First decide the purpose. Second, choose the fields. Keep only the data that is needed, and use invented data only. Third, write the field list with the data type and a validation rule for each field. Fourth, draw the data collection form. Fifth, test it with a test plan that includes normal, boundary and invalid data. Work out the expected outcome of each test before you check it. Sixth, evaluate. Is all the data necessary? Is the data in each field in the same format? Are validation rules set? Say what works and what to improve. The worked example is a seed swap; your own project must have a different purpose.

StepWhat you do
1 Purposesay what the database is for
2 Fieldsonly the data you need
3 Rulesdata type and validation for each field
4 Formclear, logical, shows formats
5 Testtest plan: normal, boundary, invalid
6 Evaluatenecessary, same format, validated
Worked examples
FieldData typeValidation rule
Seed IDautomatic numberprimary key
Plant nametextpresence check; length at most 20
Packetsnumberrange check: 1 to 20
Year packednumberrange check: 2020 to 2026
Notestextnone (the field is optional)
Purpose: a community garden keeps a record of seed packets that members swap. The field list has five fields. The notes field is optional, so it has no presence check.
TypeTest dataExpectedActualPass/fail
normalBasil, 5 packets, 2025acceptedacceptedpass
boundaryBasil, 1 packet, 2025acceptedacceptedpass
boundaryBasil, 20 packets, 2025acceptedacceptedpass
boundaryBasil, 0 packets, 2025rejectedrejectedpass
boundaryBasil, 21 packets, 2025rejectedrejectedpass
boundaryBasil, 5 packets, 2020acceptedacceptedpass
boundaryBasil, 5 packets, 2019rejectedrejectedpass
invalidno plant name, 5 packets, 2025rejectedrejectedpass
A test plan for the seed database. The expected outcomes were worked out from the rules first. The boundary values for packets are 1, 20, 0 and 21. For the year they are 2020 and 2019. All tests passed.
QuestionAnswer
Is all the data necessary?yes, each field is used when swapping seeds
Is the data in the same format?yes, the year is always four digits and packets are numbers
Are validation rules set?yes, on every field except the optional notes
What to improve?add a field for the best month to sow, with a list of months
The evaluation of the seed database. It answers the three evaluation questions, and then suggests an improvement.
Class activity

Your own database project (no computer). Choose a purpose that is not seeds, for example board-game loans in a club, uniforms in a school shop or books in a class library. Write the purpose. List five fields, using only needed data and invented records. Write a field list with a data type and a validation rule for each, including one range check and one length check. Draw a data collection form with instructions and a date format. Make a test plan with at least six tests (normal, boundary and invalid) and work out expected outcomes before checking them. Write four sentences to evaluate it. If you have a computer or tablet, ask an adult to help you type your field list.

Practice
1
A new field “Seeds per packet” has a range check of 10 to 100. Complete the expected outcome column for the values 10, 100 and 9.
Seeds per packet typedExpected outcome
10?
100?
9?
2
For the seed database, would the record (Mint, 3, 2027) be accepted? Which rule decides?
Plant namePacketsYear packed
Mint32027
3
A pupil’s database has the field “favourite colour” for a project that only lends books. Explain what is wrong when evaluating the database.
4
Write three sentences to evaluate a database in which some dates are written as 5/3/24 and others as 05/03/2024, and no validation rules are set.