Course Toolkit

The planning, design and testing tools the syllabus asks you to use, explained step by step with worked examples. Use them in any focus area.

Resources Any focus area
Standard conventions The NESA course information this site is based on does not include a notation guide (a rulebook of symbols and layouts) for Years 7 to 10. The shapes, keywords and layouts on this page are standard conventions that many teachers and textbooks use. If your teacher uses a slightly different layout, follow your teacher and keep the same ideas.

The table shows where the syllabus names each tool. Click a tool to jump to its section.

ToolWhat it helps you doFocus areas that name it
FlowchartsShow the steps of an algorithm with shapes and arrowsBuilding mechatronic and automated systems; Creating games and simulations; Developing apps and web software
PseudocodeWrite the same steps in short, plain-English linesThe same three focus areas as flowcharts
IPO chartsPlan the inputs, processes and outputs of a programCreating games and simulations
Decision treesMap every answer a program could giveCreating games and simulations
Storyboards and wireframesPlan screens, scenes and prototypes before building themDesigning for user experience. It is also a common tool for planning screens in any focus area.
Trace tables and desk checkingCheck an algorithm by hand, step by stepBuilding mechatronic and automated systems; Creating games and simulations; Developing apps and web software
Test cases and test dataDecide what to try, and what should happenAll six focus areas
Use cases and requirementsSay what a solution must do, and how wellAll six focus areas
Network maps and sociogramsDraw people or devices and the links between themModelling networks and social connections
SpreadsheetsSummarise, sort, filter and chart dataDesigning for user experience; Analysing data
Simple SQLAsk a database questions and change its dataModelling networks and social connections; Analysing data
Data modellingPlan tables, keys and the links between themDesigning for user experience; Modelling networks and social connections; Analysing data
Data types and validationChoose the right kind of data, and check itAll six focus areas (validation is named in the first three)

Flowcharts

A flowchart shows the steps of an algorithm with shapes and arrows. An algorithm is a step-by-step plan for solving a problem.

The syllabus asks you to represent algorithms with flowcharts in mechatronic systems, games and apps.

The shapes

  • Terminator (rounded ends): START at the top and END at the bottom.
  • Process (rectangle): one action or calculation, such as “Add 1 to count”.
  • Decision (diamond): a yes or no question. Both exits are labelled Yes or No.
  • Input or output (parallelogram): data coming in, such as “Input age”, or going out.
  • Subprogram (rectangle with a line down each side): a named task done elsewhere.

Concept diagram

The five flowchart symbols

A key to the five symbols this site uses in flowcharts. Each symbol has one job, so each one has one shape.

What to notice
  • Only the terminator has rounded ends. Every flowchart starts and ends with one.
  • The decision is the only symbol with two exits, and both exits must be labelled Yes or No.
  • Process, input or output, and subprogram each hold one short step. A subprogram is a named task that is done somewhere else.

Try thisChoose a routine you know, such as making toast. Write each step on its own card, then sort the cards into these five kinds of symbol.

Arrows show the order. START has one arrow out. END can have more than one arrow in, because two paths can finish at the same END.

How to draw one, step by step

  1. Write the steps in plain words, in order.
  2. Draw START at the top and END at the bottom.
  3. Turn each step into a shape. Use a rectangle for an action and a diamond for a question.
  4. Join the shapes with arrows that follow the order.
  5. Label both exits of every decision Yes or No.
FlowchartA diagram that shows an algorithm with shapes and arrows.
Flow lineAn arrow that shows the order in which steps happen.
Worked example A sports club says members must be 13 or older. This chart checks an age that is typed in.
  1. START, then input the age.
  2. Decision: is the age 13 or more? Two exits, Yes and No.
  3. Yes: show “You can join the club”, then END.
  4. No: show “Sorry, you need to be 13 or older”, then END.

Flowchart

Flowchart: the club check

Read from top to bottom. The decision has two exits, and each one is labelled Yes or No. Both paths finish at END.

What to notice
  • The first parallelogram holds the input, because the age comes in from the person using the program.
  • Each message is an output, so it is also a parallelogram. It holds the exact words the program shows.
  • Both paths end at the same END, so the program always finishes in one place.

Try thisTrace the flowchart with the ages 12 and 13. Which message does each age get? Then write the pseudocode for the same check.

Years 9–10: go further A loop is a flow line that goes back to an earlier shape, so the same steps repeat. Every loop needs a decision with one exit that leads forward, or the flow never reaches END.
Show what you know When a task asks you to draw a flowchart, a strong answer has START and END. It uses the right shape for each step, arrows that point the right way, and a Yes and No label on every decision. A common slip is using a rectangle for a question, or leaving one decision exit unlabelled.

Pseudocode

Pseudocode writes an algorithm as short, plain-English lines. It is not a real programming language, so a computer cannot run it. Its job is to help people follow the logic before they write code.

Use the same few keywords every time. Write keywords in capitals, put one step on each line, and indent the lines inside an IF or a loop.

SequenceSteps that run one after another, from top to bottom.
SelectionA choice: if a condition is true, do one thing; otherwise, do something else.
IterationRepeating steps, such as WHILE a condition is true, or FOR EACH item in a list.

Here is the club check, written three ways. Each row matches one flowchart shape to its pseudocode and Python lines.

Flowchart shapePseudocodePython
Input (parallelogram): “Input age”INPUT ageage = int(input("How old are you? "))
Decision (diamond): “age 13 or more?”IF age >= 13 THENif age >= 13:
Yes exit (output)OUTPUT "You can join the club"print("You can join the club")
No exit (output)ELSE, then OUTPUT "Sorry, you need to be 13 or older"else:, then print("Sorry, you need to be 13 or older")
End of the decisionEND IFIndentation ends the block
# The club check, written in Python
age = int(input("How old are you? "))   # input() gives text, so int() makes it a whole number
if age >= 13:
    print("You can join the club")
else:
    print("Sorry, you need to be 13 or older")

Worked example: counting down from 3 with a loop. The loop repeats while count is more than 0.

SET count TO 3
WHILE count > 0
    OUTPUT count
    SET count TO count - 1
END WHILE
OUTPUT "Go!"

The loop outputs 3, then 2, then 1. When count becomes 0, the loop stops and “Go!” is output. The full output is 3, 2, 1, Go!

Show what you know When a task asks you to write pseudocode, a strong answer uses capital keywords, one step per line, and indented lines inside each IF or loop. A common slip is mixing real code into pseudocode, or leaving out END IF or END WHILE.

IPO charts

An IPO chart is a planning table with three columns: Input, Process and Output. Before a program is written, you list what goes in, what the program does with it, and what comes out.

The Creating games and simulations focus area names IPO charts as a development tool, so they are useful when you design a game.

How to make one, step by step

  1. Write the task in one sentence.
  2. List every input: data the user types, and values the program already holds.
  3. List the process: the steps that turn the inputs into the output, in order.
  4. List the output: what the user sees or receives.
  5. Check that someone could build the program from the chart alone.
Worked example A school concert ticket costs $12. The program asks how many tickets a buyer wants, and shows the total.

Block diagram

IPO chart: the concert ticket program

An IPO chart is a table with three columns. The arrows show the order: the inputs go into the process, and the process makes the output.

InputProcessOutput
Number of tickets, typed by the buyer (for example, 3)Multiply the number of tickets by $12Total cost (for example, $36)
Price per ticket: $12, stored in the program (not typed)——
What to notice
  • The number of tickets is typed in, so it is an input.
  • The price is an input too, even though the buyer never types it. The program stores it.
  • The only process is the multiplication. Its result is the output: the total cost.

Try thisMake an IPO chart for a program that works out the change from $20 when one ticket costs $12. Which input is typed in, and which is stored in the program?

The price is an input even though the buyer never types it. Inputs can be typed in, or stored in the program.

Show what you know When a task asks you to identify or design the inputs, processes and outputs, a strong answer names each one for that task. It says “number of tickets”, not just “data”. A common slip is putting an answer in the output column without saying which process made it.

Decision trees

A decision tree starts with one question at the top. Each answer follows a branch down to the next question, or to an outcome at the end of the path. A decision tree shows every path a program could take, so you can check that none are missing.

Think of it as a flowchart that only asks questions. Every branch moves forward and ends in an outcome, so there are no loops.

How to draw one, step by step

  1. Write the first question at the top, in a box.
  2. Draw a branch for each answer, and label every branch Yes or No.
  3. At the end of each branch, put the next question in a box, or write the outcome if no more questions are needed.
  4. Keep going until every path ends in an outcome.
Worked example A school library lends laptops. Follow one student through this tree: enrolled (Yes), returned the last laptop on time (Yes), and no laptop is free (No). The outcome is “Join the waiting list”.
Enrolled at this school?
  No  -> Not allowed to borrow a laptop
  Yes -> Returned the last laptop on time?
           No  -> Return the old laptop first
           Yes -> Is a laptop free?
                    No  -> Join the waiting list
                    Yes -> Borrow a laptop

Decision tree

Decision tree: borrowing a laptop

Boxes hold the questions and the outcomes. Every branch is labelled Yes or No. The highlighted path follows one student from the first question to an outcome.

What to notice
  • Each question has its own box, and both of its branches are labelled.
  • Every path ends in an outcome, so no student is left without an answer.
  • The highlighted student answers Yes, Yes, then No, so the outcome is Join the waiting list.

Try thisA student is enrolled but did not return the last laptop on time. Follow the tree and name the outcome.

Show what you know When a task asks you to draw or describe a decision tree, a strong answer asks one question per box and labels both branches. It ends every path with an outcome. A common slip is putting two questions in one box, or leaving a branch with no label.

Storyboards and wireframes

A storyboard is a set of numbered frames. Each frame shows one moment: what the screen or scene looks like, what the user does, and what happens next. Designers use storyboards to plan an animation or a game before they build it. A storyboard is also a common tool for planning screens in any focus area, such as an app or a website.

A wireframe is a simple layout sketch of one screen. It uses plain boxes with labels, such as Title, Image or Button. It has no colours and no real content, so people can focus on where things go. A prototype is a trial model that tests an idea before the final product is built. It can be a paper sketch or a clickable digital mock-up.

How to make a storyboard, step by step

  1. Write the story or task in one sentence.
  2. Draw four to six numbered boxes, one for each moment.
  3. In each box, sketch the screen or describe the scene.
  4. Under each box, write what the user does and what happens next.
  5. Read the frames in order, as the user would. Does the story flow smoothly?
Worked example A quiz app called “Maths Quest” has three frames.
FrameWhat the user seesWhat the user doesWhat happens next
1The title “Maths Quest” and a Start buttonTaps StartFrame 2
2“7 × 8 = ?” and an answer boxTypes 56 and taps SubmitFrame 3
3“Correct! Score: 1 out of 1” (when 56 was typed) and a Play again buttonTaps Play againBack to frame 1

Wireframe

Wireframe: the title screen

A wireframe is a plain sketch of one screen. Boxes and outlines show where things go, not what they look like.

What to notice
  • The grey box at the top is for the title. The wireframe shows where the title goes, not the words.
  • The Start button is the biggest control, so it is easy to find.
  • Settings is a small link at the bottom, so it does not compete with Start.

Try thisSketch the Play again screen from frame 3 of the storyboard. Use the same kind of boxes, and label each one.

Show what you know When a task asks you to design or sketch a screen, a strong answer shows a labelled layout and explains how the user moves from frame to frame. A common slip is describing how the screen looks without saying what the user does next.

Trace tables and desk checking

A trace table records the value of each variable at each step of an algorithm. Desk checking means checking an algorithm by hand, on paper, before you run it. NESA’s glossary describes tracing as following an algorithm to check its logic and correctness, using a sample of typical inputs.

A variable is a labelled box that stores a value, such as total.

How to trace, step by step

  1. Make one column for each variable, and one for the output.
  2. Write the starting values in the first row.
  3. Work through each line in order. When a value changes, write the new value in the next row.
  4. For a loop, write one row each time round the loop.
  5. Compare the final output with what the task says it should be.
VariableA labelled box that stores a value, such as total.
Trace tableA table that records each variable’s value at each step.
Desk checkChecking an algorithm by hand before it is run.
Worked example This algorithm finds the average of three scores: 4, 7 and 2.
SET total TO 0
SET count TO 0
FOR EACH score IN (4, 7, 2)
    SET total TO total + score
    SET count TO count + 1
END FOR
OUTPUT total / count
Stepscoretotalcount
Start(none)00
Loop 1441
Loop 27112
Loop 32133
End(none)133

The output is 13 ÷ 3, which is about 4.33. The trace shows the algorithm gives that answer for this sample.

Years 9–10: go further Trace an edge case: an empty list with no scores. The loop never runs, so count stays 0. Then total ÷ count divides by zero, and the program stops with an error. Desk checking an empty list finds this bug before the program runs. A fix is to check that count is more than 0 before dividing.
Show what you know When a task asks you to trace or check an algorithm, a strong answer shows every row, with each change in the right order. It compares the final output with the expected result. A common slip is leaving out the starting row, or stopping before the last time round the loop.

Test cases and test data

A test case is a plan for one check of a program. It has three parts: the test data you type in, the expected output (what should happen), and the actual output (what really happens). If they match, the test passes.

Every focus area asks for test cases. There are three kinds of test data:

  • Typical: normal data, such as 15 for an age.
  • Boundary (edge): values on a limit, such as 12 and 13 for “13 or older”.
  • Invalid: data the program should reject, such as “twelve”.

How to write test cases, step by step

  1. Take each rule, such as “13 or older can join”.
  2. Write one typical test, then boundary tests: the limit and the value just below it.
  3. Write invalid tests: wrong types, or values the rules do not allow.
  4. Write the expected output first, then mark each test Pass or Fail.
Worked example The first version of the club check used if age > 13:. Four tests were run on it.
TestKind of dataInputExpected outputActual outputResult
1Typical15You can join the clubYou can join the clubPass
2Boundary (limit)13You can join the clubSorry, you need to be 13 or olderFail
3Boundary (below it)12Sorry, you need to be 13 or olderSorry, you need to be 13 or olderPass
4Invalid (text)twelvePlease type a whole numberAn error stops the programFail

Test 2 and Test 4 showed the two faults. This fixed version handles both. Run all four tests again.

text = input("How old are you? ")
if not text.isdigit():                # digits only (also rejects negatives)
    print("Please type a whole number")
else:
    age = int(text)
    if age >= 13:                     # fixed: 13 is now allowed
        print("You can join the club")
    else:
        print("Sorry, you need to be 13 or older")
Years 9–10: go further Group inputs that should behave the same way: ages up to 12 form one group, and 13 and over form another. Test one or two values from each group.
Show what you know When a task asks you to develop or test, a strong answer includes typical, boundary and invalid data. It states the expected output before testing, and gives Pass or Fail with a reason. A common slip is testing only typical values.

Use cases and requirements

A requirement is something a solution must do, or must be like. Before anyone builds a program, the people who will use it agree on its requirements. There are two kinds:

  • Functional requirements say what the solution must do, such as “shows each student’s due date”.
  • Non-functional requirements say how well it must work, such as how fast, easy, safe or private it is.

A use case describes one thing a user does with a solution, step by step. It names the actor (the user or device), the goal and the main steps.

How to write a use case, step by step

  1. Name it with a short verb phrase, such as “Borrow a book”.
  2. Name the actor and the goal.
  3. List the main steps in order, showing what the user does and what the system does.
  4. Add what happens if something goes wrong.
Worked example Use case: Borrow a book. Actor: a student. Goal: take a book home with a due date.
  1. The student scans their library card.
  2. The system checks the card and shows the student’s name.
  3. The student scans the book.
  4. The system records the loan and shows the due date.
  5. If the card is not recognised, the system shows “Card not recognised” and the loan stops.

Requirements for the library app:

RequirementTypeWhy it matters
The system shows the due date after each loanFunctionalThe student needs to know when to return the book.
The screen responds within two seconds of a tapNon-functional (speed)Students will not want to wait.
Buttons are large enough to tap easily on a phoneNon-functional (ease of use)Small buttons cause mis-taps.
Student details can only be seen by logged-in staffNon-functional (privacy and security)Personal information must be protected.
Years 9–10: go further Non-functional requirements can compete. A very strict login check makes an app more secure, but it may also make it slower and harder to use. When two requirements clash, write down which one matters more for this solution, and why.
Show what you know When a task asks you to specify requirements, a strong answer gives each one a type and writes it so a test could say yes or no. It describes non-functional requirements as qualities, not features. A common slip is writing “has a button” as a non-functional requirement, or “the app is good”, which cannot be tested.

Network maps and sociograms

A network map shows devices or people as dots, and the connections between them as lines. In a network map, each dot is a node, and each line is a link. A sociogram is a network map of people, showing who is linked to whom.

The degree of a node is the number of links that touch it. A path is a route from one node to another, following the links. The shortest path has the fewest links.

How to draw one, step by step

  1. List the nodes: each person or device.
  2. Draw each node as a labelled circle.
  3. For each node, list who or what it is directly linked to.
  4. Draw one line for each link. Do not draw the same link twice.
  5. Count the degree of each node, then trace paths along the lines.
NodeA dot in a network: a person or a device.
LinkA line that joins two nodes.
DegreeThe number of links that touch a node.
PathA route from one node to another, along links.
Worked example Five friends: Ava, Ben, Chloe, Dev and Ella. The links are Ava to Ben, Ava to Chloe, Ben to Chloe, Chloe to Dev, and Dev to Ella.
NodeLinked toDegree
AvaBen, Chloe2
BenAva, Chloe2
ChloeAva, Ben, Dev3
DevChloe, Ella2
EllaDev1

Chloe has the highest degree, so she is the best connected person in this group. The path from Ava to Ella is Ava, Chloe, Dev, Ella: 3 links. The longer route through Ben has 4 links.

Graph

Sociogram: five friends

A sociogram is a network map of people. Each circle is a node (a person), and each straight line is a link between two people.

What to notice
  • Chloe has 3 links, the most of anyone, so she is the best connected person in this group.
  • The highlighted path goes Ava, Chloe, Dev, Ella. It has 3 links.
  • Ben is linked to Ava and Chloe, but not to Dev or Ella.

Try thisAdd a link between Ben and Dev. Which two nodes have a new degree, and how many shortest paths from Ava to Ella are there now?

Years 9–10: go further Add up the degree of every node and you get exactly twice the number of links, because each link touches two nodes. Check the example: 2 + 2 + 3 + 2 + 1 = 10, and there are 5 links, so 10 = 2 × 5.
Show what you know When a task asks you to represent a network or calculate on it, a strong answer labels every node and draws each link once. It counts each degree and lists a path’s nodes in order. A common slip is drawing a link twice or leaving one out, which changes the degree of two nodes.

Spreadsheets

A spreadsheet is a grid of cells. Each cell has a column letter and a row number, such as B3 (column B, row 3). That address is the cell reference. A range is a block of cells, written with a colon: C2:C6 means cells C2 down to C6.

A formula starts with an equals sign and uses functions, listed here.

FunctionWhat it doesExample
SUMAdds the numbers in a range=SUM(C2:C6)
AVERAGEWorks out the mean=AVERAGE(C2:C6)
COUNTCounts the cells that hold numbers=COUNT(C2:C6)
COUNTIFCounts the cells that match a rule=COUNTIF(B2:B6,"Red")
MIN and MAXFinds the smallest or largest=MAX(C2:C6)
IFPicks one result if a test is true, another if not=IF(C2>=12,"Yes","No")

Made-up sports day list:

RowABC
1NameTeamScore
2AvaRed14
3BenBlue9
4ChloeRed17
5DevGreen11
6EllaBlue20
Worked example
  1. =SUM(C2:C6): 14 + 9 + 17 + 11 + 20 = 71
  2. =AVERAGE(C2:C6): 71 ÷ 5 = 14.2
  3. =COUNTIF(B2:B6,"Red"): 2, for Ava and Chloe
  4. =IF(C3>=12,"Yes","No"): Ben scored 9, so “No”

How to use one, step by step

  1. Type a heading in row 1, and one kind of data in each column.
  2. Start a formula with = in an empty cell. Check that the range covers every row.
  3. Sort by score, highest first: Ella, Chloe, Ava, Dev, Ben.
  4. Filter to one team, such as Blue: Ben and Ella.
  5. Use conditional formatting to colour cells that meet a rule, such as scores of 15 or more.
  6. Select the names and scores, then insert a column chart.

Menu names differ between programs. Look for Sort, Filter, Conditional formatting and Chart.

Concept diagram

A spreadsheet grid, with cell C6 highlighted

Columns are lettered across the top and rows are numbered down the side. A cell’s address is its column letter followed by its row number.

What to notice
  • C6 is in column C, in row 6. It holds 20, which is Ella’s score.
  • Row 1 holds the headings, so the scores start at row 2. The range C2:C6 covers the five scores.
  • Because C6 is inside C2:C6, the formula =SUM(C2:C6) includes Ella’s score.

Try thisWhich cell holds Chloe’s score? Write its address.

Years 9–10: go further When you copy a formula, its references move with it. Copying =SUM(C2:C6) one row down gives =SUM(C3:C7). To keep a reference fixed, add dollar signs: =SUM($C$2:$C$6).
Show what you know When a task asks you to use a spreadsheet, a strong answer writes each formula with the right range and checks one result by hand. A common slip is a range that stops one row early, such as C2:C5, which leaves out Ella’s score, or forgetting the quote marks around text in COUNTIF.

Simple SQL

SQL is a language for asking a database questions and changing its data. A database stores data in tables. Each table has records (rows, one for each item) and fields (columns, one for each kind of fact).

The syllabus names SELECT, WHERE, ORDER BY and LIMIT, and asks you to insert and update data. AND, OR and NOT join conditions. FROM, INTO, VALUES and SET complete these statements. DESC and ASC set the order (highest first, or lowest first). The syllabus does not name them, so treat them as an extra. No other keywords appear here.

DatabaseData organised into tables that can be searched and changed.
RecordOne row in a table, holding one item.
FieldOne column in a table, holding one kind of fact.

This is a made-up table called Games.

GameIDTitleGenreReleaseYearPrice ($)
1Star QuestAdventure201930
2Block BuilderPuzzle202115
3Road RallyRacing201825
4Pixel PetsPuzzle202310
5Sky NinjaAction202235
6Dino DigAdventure202020

Worked examples

Query 1: the puzzle games and their prices.

SELECT Title, Price
FROM Games
WHERE Genre = 'Puzzle';

Result: Block Builder (15) and Pixel Pets (10).

Query 2: the three most expensive games.

SELECT Title, Price
FROM Games
ORDER BY Price DESC
LIMIT 3;

Result: Sky Ninja (35), Star Quest (30) and Road Rally (25).

Query 3: non-puzzle games that cost less than $30, in alphabetical order.

SELECT Title
FROM Games
WHERE NOT (Genre = 'Puzzle') AND Price < 30
ORDER BY Title ASC;

Result: Dino Dig, then Road Rally. To match either genre instead, use OR: WHERE Genre = 'Adventure' OR Genre = 'Racing' returns Dino Dig, Road Rally and Star Quest.

Query 4: add a game, then change a price.

INSERT INTO Games (GameID, Title, Genre, ReleaseYear, Price)
VALUES (7, 'Ocean Run', 'Racing', 2024, 18);

UPDATE Games
SET Price = 12
WHERE GameID = 2;

Result: the table gets a seventh row, Ocean Run. Block Builder now costs $12, not $15. Without the WHERE line, the UPDATE would change every row.

Show what you know When a task asks you to write a query, a strong answer uses the clauses in order (SELECT, FROM, WHERE, ORDER BY, LIMIT). It puts text in single quotes and includes WHERE in every UPDATE. A common slip is putting ORDER BY before WHERE, or writing an UPDATE with no WHERE, which changes every row.

Data modelling

Data modelling means planning how data will be organised before a database is built. You decide what to store (entities), which facts to keep about each (attributes) and how they link (relationships).

Each table needs a primary key: an attribute whose value is different for every record, such as PlayerID. A foreign key is a field that holds another table’s primary key.

How to model, step by step

  1. List the entities. For a sports club, these are Team and Player.
  2. List the attributes of each entity, and choose a primary key.
  3. Decide how the entities link. One team has many players, but each player is in one team: one-to-many.
  4. Put the foreign key on the “many” side. The Player table holds TeamID.
  5. Check that each player points to exactly one team.
EntityA thing you store data about.
AttributeA fact kept about each entity.
Primary keyAn attribute whose value is unique for each record.
Foreign keyA field that holds another table’s primary key.
RelationshipThe link between two tables, such as one-to-many.
Worked example Two linked tables for a sports club: Team is the one side, Player the many side.

Team table

TeamID (PK)TeamNameCoach
T1Riverside RobinsMs Tran
T2Hilltop HawksMr Osei

Player table

PlayerID (PK)PlayerNamePositionTeamID (FK)
P1SamGoalT1
P2MiaDefenceT1
P3JordanMidfieldT2
P4LeoGoalT2

The team name is stored once, in the Team table, not repeated in every player row. If it changed, only one row would need changing.

Concept diagram

Two linked tables: Team and Player

Each table is a box with its name on top and one field on each line. The line joins the two tables through TeamID.

What to notice
  • PK marks the primary key. Each value in that field is different for every record.
  • FK marks the foreign key. The TeamID in Player holds a TeamID from the Team table.
  • The 1 is at the Team end and many is at the Player end, so one team has many players.

Try thisFind the team for player P3, Jordan. Write down the TeamID, then the team name from the Team table.

Years 9–10: go further Some links are many-to-many, such as players in several clubs. One foreign key cannot show this, so add a joining table with one row for each player and club pair.
Show what you know When a task asks you to model data, a strong answer names each entity and gives each table one primary key. It marks the foreign key and says whether each link is one-to-many. A common slip is a primary key that repeats, or storing the team name in every player row instead of linking with TeamID.

Data types and validation

A data type tells the computer what kind of value a field or variable holds. The right type stops mistakes. For example, you cannot add up names.

Data typeWhat it holdsExample
IntegerWhole numbers, with no decimal point14 goals, -3
FloatNumbers with a decimal point4.5 minutes, $2.50
StringText, including digits that are not used in sumsAva, 0412 345 678
BooleanOne of two values, True or Falsepaid = True
DateA calendar day, written day/month/year14/03/2027

Names vary between programs, so these are the common names. A phone number should be a string. 0412 345 678 starts with a zero, and an integer would lose that zero.

Validation checks that data is sensible before the program uses it. The main checks are:

CheckQuestion it asksExample
PresenceHas something been entered?A name must not be blank.
TypeIs it the right kind of data?An age must be a number, not “twelve”.
RangeIs it between the smallest and largest allowed values?A test score must be from 0 to 100.
FormatDoes it follow the right pattern?A date must look like dd/mm/yyyy.
text = input("Enter the score: ")
if text == "":                        # presence: something was typed
    print("Please type a score.")
elif not text.isdigit():              # type: digits only, so a minus sign is also rejected
    print("Scores must be whole numbers.")
elif int(text) > 100:                 # range: 100 is the largest allowed
    print("Scores must be 100 or less.")
else:
    print("Score accepted:", int(text))

Each check in the code matches a row of the table. Try nothing typed, then “abc”, “150” and “42”. They give the presence, type and range messages, and then “Score accepted: 42”.

Show what you know When a task asks you to choose a data type or validate data, a strong answer names a sensible type and gives one check. It also gives an example input that the check should reject. A common slip is choosing integer for a phone number or code, which loses a leading zero.