← QCE Digital Solutions Unit 4

Data consistency

Data is consistent when the same thing is recorded in the same form (one spelling, date format and unit) and agrees everywhere it appears, including across different sources.

Understanding Data consistency in QCE Digital Solutions Unit 4

What it does: Comparing the same field across sources shows whether the values match, which is consistency across different sources. Converting every value to one unit makes the column consistent, so values can be compared and calculated correctly. Consistent data records the same thing in the same form. Three spellings of one value mean the data is inconsistent and will cause problems when grouping or counting. Consistent data uses one date format throughout. Mixing formats such as YYYY-MM-DD, D/M/YY and D Mon YYYY makes dates hard to sort and compare. A fixed list means each value is recorded in one form. Free typing leads to spelling variations such as Qld, QLD and Queensland.

Common mistakes: The fix dictionary uses lowercase keys, so the input must be converted with lower(). With upper(), 'QLD' never matches 'qld' and the spelling variation is not standardised. After converting pounds to kilograms, the unit label must be changed to 'kg'. Keeping 'lb' means the value and its unit disagree, so the units are inconsistent. It should be unit = 'kg'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 127–333) and word search (Modules 127–401).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A student table records the house as 'Red', 'red' and 'RED'. Is this data consistent?
Yes, they all mean the same house so it is consistentNo, one house is recorded in three different spellings
Matches
State column holds: QLD, Qld, Queensland, qld
↓
The same state is spelled four different ways. Choose one form, such as QLD, and use it for every record.
Applying
Meanings
Term
Data consistency
Meaning
Data is consistent when the same thing is recorded in the same form (one spelling, date format and unit) and agrees everywhere it appears, including across different sources.
Practice
SELECT DISTINCT house
Testing
Gaps
city = city.().strip()
Check Answer
Spots
1state = raw.strip().upper()
2fix = {'qld': 'Queensland'}

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Sea Turtle' badge — Scope Navigator, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A student table records the house as 'Red', 'red' and 'RED'. Is this data consistent?
A. No, one house is recorded in three different spellings ✓
B. Yes, they all mean the same house so it is consistent
Consistent data records the same thing in the same form. Three spellings of one value mean the data is inconsistent and will cause problems when grouping or counting.
2. Which set of dates is consistent?
A. 2026-02-03, 2026-02-05, 2026-02-09 ✓
B. 2026-02-03, 5/2/26, 9 Feb 2026
Consistent data uses one date format throughout. Mixing formats such as YYYY-MM-DD, D/M/YY and D Mon YYYY makes dates hard to sort and compare.
3. One column records distance as '5 km', '3000 m' and '2.5 km'. What is the consistency problem?
A. There is no problem because every value is a distance
B. The units are mixed, so the values cannot be compared directly ✓
Consistency applies to units as well as spelling and dates. Convert everything to one unit, such as km, so values can be compared and calculated.
4. A school's enrolment system says a student is in Year 11, but the library system says Year 12. Which statement is true?
A. The data is inconsistent because it disagrees across sources ✓
B. The data is consistent because each system is correct on its own
Consistency also means data agrees everywhere it appears. A value that differs between two sources is inconsistent, even if each system looks tidy by itself.
5. Which approach best keeps data consistent when many people enter a state name?
A. Let everyone type it however they like
B. Use a fixed list, such as a drop-down with QLD, NSW and VIC ✓
A fixed list means each value is recorded in one form. Free typing leads to spelling variations such as Qld, QLD and Queensland.

Match the Pairs

df['suburb'].str.title() → Makes every suburb name use the same capitalisation, so 'brisbane' and 'BRISBANE' both become 'Brisbane'
pd.to_datetime(df['date'], dayfirst=True) → Converts mixed date entries into one date format, using day-month-year order when reading them
Two sources must agree: a student's year level in the enrolment file should match the year level in the results file → enrol['year'] == results['year']
Units must be consistent: a height column mixes metres and centimetres, so every value is converted to centimetres → height_cm = height_m * 100
State column holds: QLD, Qld, Queensland, qld → The same state is spelled four different ways. Choose one form, such as QLD, and use it for every record.
Dates in one column: 03/04/2025, 2025-04-03, 3 Apr 25 → The same date is recorded in three formats. Pick one format, such as YYYY-MM-DD, and use it for every entry.

Key Term

Data consistency
Data is consistent when the same thing is recorded in the same form (one spelling, date format and unit) and agrees everywhere it appears, including across different sources.

Fill in the Blanks

1. city = city.lower().strip()
Hint: Type the string method that turns every letter into its small form so spelling matches
2. fixes = {"bne": "brisbane"} if city in fixes: city = fixes[city]
Hint: Type the keyword that tests whether a value is present in the dictionary
3. from datetime import datetime d = datetime.strptime(text, "%d/%m/%Y") print(d.strftime("%Y-%m-%d"))
Hint: Type the method that parses text into a date using a format pattern
4. metres = round(cm / 100, 2)
Hint: Type the built-in function that tidies a converted number to a set number of decimal places
5. if sales != ledger: print("Sources disagree")
Hint: Type the keyword that starts a selection to check whether two sources disagree

Spot the Error

Question 1
A state = raw.strip().upper()
B fix = {'qld': 'Queensland'}
C state = fix.get(state, state)
D print(state)
Line A — The fix dictionary uses lowercase keys, so the input must be converted with lower(). With upper(), 'QLD' never matches 'qld' and the spelling variation is not standardised.
Question 2
A for w, unit in rows:
B if unit == 'lb':
C w = w * 0.4536
D unit = 'lb'
E clean.append((w, unit))
Line D — After converting pounds to kilograms, the unit label must be changed to 'kg'. Keeping 'lb' means the value and its unit disagree, so the units are inconsistent. It should be unit = 'kg'.
Question 3
A a = crm_email.strip().lower()
B b = shop_email.strip().upper()
C if a != b:
D print('Mismatch')
Line B — Both emails must be put in the same form before comparing them across sources. Using upper() for one and lower() for the other means matching emails never compare equal. It should be lower().
Question 4
A for d in dates:
B parts = d.split('-')
C if len(parts[0]) != 2:
D print('Bad date', d)
Line C — In a YYYY-MM-DD date the first part is the year, which has 4 digits. Checking for 2 digits would flag correct dates. It should be != 4.
Question 5
A valid = ['Red', 'Blue']
B h = row[0].strip().title()
C if h in valid:
D print('Unknown house:', h)
Line C — The check should flag values that are NOT in the list of agreed spellings. Using 'in' flags the correct values instead. It should be if h not in valid:.

Student with a class code? Join your class →