Deleting data that is no longer needed

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

Deleting data that is no longer needed

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A school finishes a sports carnival. The signup sheet with student phone numbers is no longer needed. What should happen to it?
A Delete it, because its purpose has ended
B Keep it forever in case it is useful one day
2. Which statement describes data retention?
A Keeping data only as long as its purpose needs it, then deleting it
B Keeping all data for as long as possible just in case
3. You have not used a game account for three years. It still holds your name, email and birthday. What is the best choice?
A Leave it, because unused accounts hold no risk
B Delete the account so the old data is removed
4. Your team finishes a class project that collected survey answers. When should the raw survey data be deleted?
A Never, because the data might be handy later
B Once the project is finished and the data is no longer needed
5. You delete a spreadsheet of names from your main folder, but a backup copy is still stored in cloud storage. Is the data fully deleted?
A No, the backup copy still holds the data
B Yes, deleting the main file removes every copy

Match the Pairs

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

Left columnRight column
1data retention ARemoves one old record that is no longer needed
2DELETE FROM students WHERE studentId = 7; BThe backup copy still holds the same personal data, so the data has not really been deleted.
3When a school project ends, delete the survey responses you collected for it Cdelete survey.xlsx and delete survey_backup.xlsx
4Backup copies also hold data, so they must be deleted too, not just the main file DKeeping data only as long as its purpose needs it, then deleting it
5Delete survey.xlsx but keep survey_backup.xlsx forever EThe account has no current purpose, so its data should be deleted instead of kept for no reason.
6Keep an old account open for years 'just in case' FDELETE FROM orders WHERE orderDate < '2026-02-01';

Definitions

data retention

Fill in the Blanks

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

1.
______ FROM orders WHERE orderId = 3;
2.
IF projectFinished ____ DELETE surveyData END IF
3.
backup = copy(surveyData) DELETE surveyData DELETE ______
4.
IF lastLogin _ oneYearAgo THEN DELETE account END IF
5.
DELETE FROM orders _____ orderId < 5;

Spot the Error

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

Question 1
A IF project = 'starting' THEN
B DELETE survey_answers
C END IF
Question 2
A FOR EACH acc IN accounts
B IF unused_years > 2 THEN
C KEEP acc
D END IF
E NEXT
Question 3
A DELETE FROM accounts
B WHERE active = 'yes';
C SELECT COUNT(*) FROM accounts;
Question 4
A SET limit TO 30
B FOR EACH copy IN backups
C IF copy.age < limit THEN
D DELETE copy
E END IF
Question 5
A project_finished = True
B survey_data = ['a1', 'a2']
C if project_finished:
D survey_data.clear

Answer Key

Deleting data that is no longer needed
Section A: Quick Questions
Q1
A — Delete it, because its purpose has ended
Q2
A — Keeping data only as long as its purpose needs it, then deleting it
Q3
B — Delete the account so the old data is removed
Q4
B — Once the project is finished and the data is no longer needed
Q5
A — No, the backup copy still holds the data
Section B: Match the Pairs
Q1
data retention → Keeping data only as long as its purpose needs it, then deleting it
Q2
DELETE FROM students WHERE studentId = 7; → Removes one old record that is no longer needed
Q3
When a school project ends, delete the survey responses you collected for it → DELETE FROM orders WHERE orderDate < '2026-02-01';
Q4
Backup copies also hold data, so they must be deleted too, not just the main file → delete survey.xlsx and delete survey_backup.xlsx
Q5
Delete survey.xlsx but keep survey_backup.xlsx forever → The backup copy still holds the same personal data, so the data has not really been deleted.
Q6
Keep an old account open for years 'just in case' → The account has no current purpose, so its data should be deleted instead of kept for no reason.
Section C: Definitions
Q1
data retention — Keeping data only as long as its purpose needs it, then deleting it, including old accounts, finished project data and backup copies.
Section D: Fill in the Blanks
Q1
DELETE FROM orders WHERE orderId = 3;
Q2
IF projectFinished THEN DELETE surveyData END IF
Q3
backup = copy(surveyData) DELETE surveyData DELETE backup
Q4
IF lastLogin < oneYearAgo THEN DELETE account END IF
Q5
DELETE FROM orders WHERE orderId < 5;
Section E: Spot the Error
Q1
A — The data should only be deleted once the project has finished and its purpose is over. It should be IF project = 'finished' THEN. A project that is only starting still needs its data.
Q2
C — An account that has not been used for years no longer has a purpose, so it should be deleted. The line should be DELETE acc, not KEEP acc.
Q3
B — This would delete the accounts people are still using. The old accounts to remove are the inactive ones, so it should be WHERE active = 'no';.
Q4
C — The comparison is the wrong way round, so it would delete the newest backups and keep the old ones. It should be IF copy.age > limit THEN. Backup copies also hold data and must be deleted when they are too old.
Q5
D — The brackets are missing, so clear is never called and nothing is deleted. It should be survey_data.clear() to remove the data when the project is finished.