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.

Topic 2.7 · Presence checks and primary keys8 fillable worksheet pagesRead at your own pace

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.

Today’s two goals
  • 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.
Original PaxaKids illustration for Presence checks and primary keys. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

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

A primary key identifies each record uniquely. A presence check prevents a required value from being omitted. These rules address different problems: a unique ID does not fill in missing details.

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

The BookNotes table has these five fields. Note_ID is an AutoNumber primary key generated by Access. In the starter, the four data fields are optional so that you can add the presence rules. Text capacity is 255 characters at this stage; length and numeric bounds are developed next.
Inspect the complete original structure — original model
FieldType / role
Note_IDAutoNumber; primary key
Reader_aliasShort Text; fictional reader label
Reader_ageNumber (Double); age in years
Book_titleShort Text; book being read
Reading_minutesNumber (Double); duration in minutes

Read the three fictional seed records

These records are already in the supplied starter. All aliases and reading details are invented. A duration is a data value, not a grade or rating. Each row represents one reading note, so the same alias or title could legitimately occur in later notes.
Read the three fictional seed records — original model
Note_IDAliasAgeBook titleMinutes
1Raven12Star Atlas25
2Maple11River Tale40
3Cedar13Sky Lab35

Configure presence in a working copy

Save a working copy of the starter. In desktop Access, open BookNotes in Design View and select each data field. Set Required to Yes for Reader_alias, Reader_age, Book_title and Reading_minutes. For the two text fields, also set Allow Zero Length to No. Save the table and test new records in Datasheet View.

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.
Configure presence in a working copy — original model
PropertySetting for this practice
RequiredYes on all four non-key data fields
Allow Zero LengthNo on Reader_alias and Book_title

Predict the omitted-field tests

After setting the presence rules, test each omission independently. Other fields use Finch, age 12, Star Atlas and 20 minutes. Let Note_ID generate. Predict Accept or Reject for the named field left Null.
Predict the omitted-field tests — original model
One omitted fieldExpected 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

Also test an empty string in each required text field, then a complete new record. Check that the complete record receives a new unique generated ID. AutoNumber values can have gaps; do not assume the next ID equals the record count plus one.

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.

Paxa the Fox

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
  1. Lesson 2.1: Models, simulators and useful features
  2. Lesson 2.2: Data for users and model designers
  3. Lesson 2.3: Spreadsheet models and what-if changes
  4. Lesson 2.4: Goal seek and checking a target
  5. Lesson 2.5: Data requirements and completeness
  6. Lesson 2.6: Fields, records and consistent formats
  7. Lesson 2.7: Presence checks and primary keys
  8. Lesson 2.8: Length and range checks
  9. Lesson 2.9: A validated entry form
  10. Lesson 2.10: Evaluating and designing a database
  11. Lesson 2.11: Project: Presentation time!
  12. 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.

Presence checks and primary keys8 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

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

Download worksheet PDF ↓

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

  1. Question 1: What does a presence check establish? a required value is present

Worksheet 2

  1. Question 2: Which field is the primary key? Note_ID
  2. Question 3: How many data fields need the new presence check, excluding the generated key? 4

Worksheet 3

  1. Question 4: Why is Book_title a weaker key than Note_ID? different notes can refer to the same book
  2. 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

  1. Question 6: Which pair addresses Null and empty-string omissions in a required text field? Required Yes and Allow Zero Length No

Worksheet 5

  1. Question 7: Null Reader_alias Reject
  2. Question 8: Null Reader_age Reject
  3. Question 9: Null Book_title Reject
  4. Question 10: Null Reading_minutes Reject
  5. Question 11: If every attempted new record is rejected, how many saved seed records remain? 3
  6. Question 12: What should you check after a rejection? no partial row saved

Worksheet 6

  1. Question 13: Which proposed key would be invalid for a new saved record? an ID already used by an existing record

Worksheet 7

  1. 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

  1. 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.
Back to my workbook ↑

Curriculum & workbook reference

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.