Sorting data

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Sorting data

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Sorting a table by the Name column from A to Z puts the rows in which order?
A Ana, Ben, Cara, Dev
B Dev, Cara, Ben, Ana
2. Which choice shows sorting numbers from smallest to largest?
A 3, 8, 15, 42
B 42, 15, 8, 3
3. A table has Name and Score columns. You sort by Score. What happens to each student's name?
A It moves with their score, so the row stays together
B It stays where it was while the scores move
4. Sorting reorders the rows of a table using the values in how many columns (in a simple sort)?
A Every column at once
B One column
5. Mia sorts only the Age column in her table. Her Name column stays still. What went wrong?
A Nothing went wrong, because sorting only needs one column to move
B The rows were not kept together, so names and ages are now mixed up

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Sort A to Z AThese ages are not in order from smallest to largest. The correct order is 9, 10, 11, 12.
2Sort smallest to largest BSort by Price (smallest to largest)
3To put a class list in alphabetical order by Name, sort the Name column CSort by Name (A to Z)
4To see the cheapest snack first, sort the Price column from smallest to largest DThe columns were sorted separately, so each score no longer matches its name. The fix is to sort the whole table so each row stays together.
5Only the Score column was sorted. The Name column stayed in the same order. EPuts the rows in order from the lowest number to the highest number in one column
6Sort by Age: 12, 9, 11, 10 (smallest to largest) FPuts the rows in alphabetical order using the text in one column

Definitions

Sort

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
____ the table by the Score column
2.
Sort the Name column from ______
3.
Sort Score from smallest to _______
4.
Sorting keeps each ___ together
5.
Columns: Name, Score (points) Sort the rows by _____, largest to smallest

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A pets ← table of Name, Age
B column ← Age
C order ← smallest to largest
D sort pets by Name, order
Question 2
A Select the whole table A1:C6
B Sort column B on its own
C Check each row stayed together
Question 3
A names ← Zoe, Ali, Mia
B sort names A to Z
C result ← Zoe, Mia, Ali
Question 4
A scores ← 12, 5, 30, 8
B sort scores smallest first
C result ← 30, 12, 8, 5
Question 5
A Before: Mia 10, Ali 8, Zoe 9
B Sort by Name, A to Z
C After: Ali 10, Mia 8, Zoe 9

Answer Key

Sorting data
Section A: Quick Questions
Q1
A — Ana, Ben, Cara, Dev
Q2
A — 3, 8, 15, 42
Q3
A — It moves with their score, so the row stays together
Q4
B — One column
Q5
B — The rows were not kept together, so names and ages are now mixed up
Section B: Match the Pairs
Q1
Sort A to Z → Puts the rows in alphabetical order using the text in one column
Q2
Sort smallest to largest → Puts the rows in order from the lowest number to the highest number in one column
Q3
To put a class list in alphabetical order by Name, sort the Name column → Sort by Name (A to Z)
Q4
To see the cheapest snack first, sort the Price column from smallest to largest → Sort by Price (smallest to largest)
Q5
Only the Score column was sorted. The Name column stayed in the same order. → The columns were sorted separately, so each score no longer matches its name. The fix is to sort the whole table so each row stays together.
Q6
Sort by Age: 12, 9, 11, 10 (smallest to largest) → These ages are not in order from smallest to largest. The correct order is 9, 10, 11, 12.
Section C: Definitions
Q1
Sort — Sorting puts the rows of a table in order using the values in one column, like A to Z or smallest to largest, and keeps each row together.
Section D: Fill in the Blanks
Q1
Sort the table by the Score column
Q2
Sort the Name column from A to Z
Q3
Sort Score from smallest to largest
Q4
Sorting keeps each row together
Q5
Columns: Name, Score (points) Sort the rows by Score, largest to smallest
Section E: Spot the Error
Q1
D — The column chosen on line 2 is Age, so the sort must use Age. Sorting by Name would give A to Z order, not smallest to largest. It should be: sort pets by column, order.
Q2
B — Sorting one column on its own pulls its values away from the rest of their rows. You must sort the whole table by column B so each row stays together.
Q3
C — A to Z means alphabetical order, so the result should be Ali, Mia, Zoe. The broken line shows Z to A.
Q4
C — Sorting smallest first puts the numbers in order from smallest to largest: 5, 8, 12, 30. The broken line shows largest to smallest.
Q5
C — Each row must stay together when sorting. Ali's number should still be 8 and Mia's should still be 10. It should be: After: Ali 8, Mia 10, Zoe 9.