GRADE 8 · COMPUTING · UNIT 2 · LESSON 2.7
Managing data
Presence checks and primary keys
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
Presence checks and primary keys
A primary key uniquely identifies a record. A presence check requires a value but does not establish that it is accurate. Define empty-value handling for the software and field type being used.
- Identify a unique record key and prevent omission of required entries.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
An automatically generated ReviewID can distinguish two reviews of the same book. Requiring the BookTitle field to be nonempty prevents a missing title but still permits a misspelled title.
Try before your workbook
Does a nonempty but incorrect title pass a simple presence check?
Explore the clues
Tap one card to find out more.
Understand the idea
A primary key uniquely identifies a record. A presence check requires a value but does not establish that it is accurate. Define empty-value handling for the software and field type being used.
Concept to practise: Presence checks and primary keys.
Work through an example
An automatically generated ReviewID can distinguish two reviews of the same book. Requiring the BookTitle field to be nonempty prevents a missing title but still permits a misspelled title.
Try before your workbook
Does a nonempty but incorrect title pass a simple presence check?
Check my readiness thinking
Yes. Presence checks for a required value, not factual correctness. Other review or validation is needed to identify an incorrect title.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Require the data that a record needs
Use our original fictional BookNotes database. It records a reading session using an invented alias, age, book title and reading duration. The supplied starter is ready for you to add presence rules; it is not the publisher’s missing download.
Inspect the complete original structure
| Field | Type / role |
|---|---|
| Note_ID | AutoNumber; primary key |
| Reader_alias | Short Text; fictional reader label |
| Reader_age | Number (Double); age in years |
| Book_title | Short Text; book being read |
| Reading_minutes | Number (Double); duration in minutes |
Read the three fictional seed records
| Note_ID | Alias | Age | Book title | Minutes |
|---|---|---|---|---|
| 1 | Raven | 12 | Star Atlas | 25 |
| 2 | Maple | 11 | River Tale | 40 |
| 3 | Cedar | 13 | Sky Lab | 35 |
Configure presence in a working copy
Required prevents Null omissions. A zero-length string contains no characters; text settings must address that separately. An Is Not Null validation rule is another Null check, but does not by itself prove meaningful text or a true fact.
References: required values, primary keys, zero-length strings.
| Property | Setting for this practice |
|---|---|
| Required | Yes on all four non-key data fields |
| Allow Zero Length | No on Reader_alias and Book_title |
Predict the omitted-field tests
| One omitted field | Expected decision |
|---|---|
| Reader_alias | {'clue': 'Decision', 'prompt': 'Null Reader_alias', 'answers': ['Reject']} |
| Reader_age | {'clue': 'Decision', 'prompt': 'Null Reader_age', 'answers': ['Reject']} |
| Book_title | {'clue': 'Decision', 'prompt': 'Null Book_title', 'answers': ['Reject']} |
| Reading_minutes | {'clue': 'Decision', 'prompt': 'Null Reading_minutes', 'answers': ['Reject']} |
Check what these rules still do not prove
A presence check does not decide whether an age or duration is sensible. It also cannot prove an alias, title or duration agrees with its source.
Files for this activity
Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Try one step with Paxa!
Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.
Our Unit 2 learning path
- Lesson 2.1: Models, simulators and useful features
- Lesson 2.2: Data for users and model designers
- Lesson 2.3: Spreadsheet models and what-if changes
- Lesson 2.4: Goal seek and checking a target
- Lesson 2.5: Data requirements and completeness
- Lesson 2.6: Fields, records and consistent formats
- Lesson 2.7: Presence checks and primary keys
- Lesson 2.8: Length and range checks
- Lesson 2.9: A validated entry form
- Lesson 2.10: Evaluating and designing a database
- Lesson 2.11: Project: Presentation time!
- Lesson 2.12: Check your progress 2
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 8 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.1 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 8 worksheets
Worksheet 1
- Question 1: What does a presence check establish? a required value is present
Worksheet 2
- Question 2: Which field is the primary key? Note_ID
- Question 3: How many data fields need the new presence check, excluding the generated key? 4
Worksheet 3
- Question 4: Why is Book_title a weaker key than Note_ID? different notes can refer to the same book
- Question 5: Does a numeric value of 0 mean the same as Null? no; zero is a supplied number, while Null is missing or unknown
Worksheet 4
- Question 6: Which pair addresses Null and empty-string omissions in a required text field? Required Yes and Allow Zero Length No
Worksheet 5
- Question 7: Null Reader_alias Reject
- Question 8: Null Reader_age Reject
- Question 9: Null Book_title Reject
- Question 10: Null Reading_minutes Reject
- Question 11: If every attempted new record is rejected, how many saved seed records remain? 3
- Question 12: What should you check after a rejection? no partial row saved
Worksheet 6
- Question 13: Which proposed key would be invalid for a new saved record? an ID already used by an existing record
Worksheet 7
- Question 14: Use a working copy of the supplied original BookNotes starter, or rebuild the table from pages 2–3. Keep Note_ID as an automatically generated primary key. Configure the four required data fields and prevent empty strings in the two text fields. Predict and test each of the four Null omissions, both empty-string cases and one complete record, restoring or cancelling the test record between trials. Record actual accepted/rejected outcomes and messages or Pending, saved-record checks, new generated key, correction and retest. If software is unavailable, complete the paper settings and test predictions and mark the software run Pending. Retain the source database, settings and evidence log; cite your contribution here. Correct original five-field table, fictional three seeds and AutoNumber primary key. Four non-key fields Required Yes; both text fields Allow Zero Length No, or equivalent enforced checks honestly identified. Four Null omissions and two zero-length cases rejected; complete valid new record accepted with a generated unique key, without assuming a consecutive next ID. Actual learner native/equivalent database evidence or clearly labelled paper predictions/Pending, cancelled or restored test records, source/settings/logs retained and correction/retest shown. CSV not claimed to enforce rules; author DAO checks not learner GUI completion. Grown-up review; personal evidence is required.
Worksheet 8
- Question 15: Prepare a short reminder sheet explaining record, field and primary key using BookNotes. Compare the key with Reader_alias and Book_title, which may repeat. Explain Null, a supplied zero and a zero-length string; show which settings address the omissions. Describe why a filled and uniquely identified record can still contain an incorrect or unreasonable value, with one original example and a later check it needs. Give a simple sequence for remembering how to configure, save and test presence rules. Review with a partner or teacher, record actual feedback or Pending, improve the reminder and cite the full sheet and evidence here. Accurate field/record/unique nonblank key explanation; alias/title not assumed unique. Null distinguished from numeric zero and empty string. Required prevents Null; text zero-length rule addressed; whitespace/meaning and truth not guaranteed by a presence rule. AutoNumber generated, gaps possible and not a record count. Relevant original unreasonable or inaccurate value and justified later range/source check. Clear configuration/save/test reminder, actual review or Pending, improvement and retained own evidence; no numerical grading. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 218–219
- PaxaKids Grade 8 Computing Lesson 2.7: Presence checks and primary keys — pages 1–8
Computing for your homeschool day
Explore Presence checks and primary keys with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
