Skip to content
IGCSE·Tuition
ICT · Practice

Database structure and validation: original mixed practice with explanations

Knowing each idea separately is one thing, and choosing the right one when a mixed table lands in front of you is another.

On this page
  1. Questions 1 to 4: types and keys
  2. Questions 5 to 8: validation and numeric-text
  3. Questions 9 to 12: import and duplicates
  4. If you got these wrong

These twelve questions mix the five skills in database structure and validation: choosing field types, setting keys and validation, importing, spotting numeric-text mix-ups and explaining duplicates. All data is invented for this page. Questions go from easier to harder.

Try each one on paper first, then open the answer. Write explanations in full sentences, because that is how an exam rewards them.

Questions 1 to 4: types and keys

Q1. A table of school canteen items has the columns ItemCode (such as CN-012), Price (such as 3.50), StockCount (such as 48) and Vegetarian (Yes or No). Give a field type for each column.

Show answer
  • ItemCode: text, because it holds letters and a hyphen and is never calculated.
  • Price: currency or decimal, because it has two decimal places and is multiplied or added.
  • StockCount: integer, because it is a whole count.
  • Vegetarian: Boolean (yes/no), because only two values appear.

Q2. Explain why a membership number such as 007245 should be stored as text and not as a number.

Show answer

It is a label, not a quantity, since nobody adds or averages membership numbers. In a number field the zeros at the start would be dropped, giving 7245, which no longer matches the real number. Text keeps all six characters.

Q3. A table of library loans has the fields LoanID, BookTitle, BorrowerName and DateBorrowed. Which is the most suitable primary key, and why are the other three unsuitable?

Show answer

LoanID. It is unique for each loan, always present and never changes. BookTitle repeats when a book is borrowed more than once, BorrowerName repeats when one person borrows twice, and DateBorrowed repeats when two loans happen on one day.

Q4. A new table needs an ID of exactly 6 characters. Which type of check is this? Say whether ST0045 and ST045 are accepted.

Show answer

A length check. ST0045 has 6 characters, so it is accepted. ST045 has 5 characters, so it is rejected.

Questions 5 to 8: validation and numeric-text

Q5. A Mark field must accept whole marks from 0 to 100 inclusive. Write a validation condition and test it with 100, 101, 0 and -1.

Show answer

Condition: >=0 AND <=100.

  • 100: 100 >= 0 true and 100 <= 100 true, accepted.
  • 101: 101 <= 100 false, rejected.
  • 0: 0 >= 0 true and 0 <= 100 true, accepted.
  • -1: -1 >= 0 false, rejected.

The boundaries 0 and 100 are accepted because the question says inclusive.

Q6. A teacher enters 54 for a student whose real mark is 45. The Mark field has the rule from Q5. Does validation catch this? Explain.

Show answer

No. 54 is inside the range 0 to 100, so it passes. Validation only tests whether a value is reasonable and allowed. Catching a transposed value needs verification, such as comparing the entry with the original mark sheet.

Q7. A column stored as text contains 5, 12, 120 and 9. Write the order it shows when sorted ascending, and the order after converting to integer.

Show answer

As text: compare character by character. The first characters are 5, 1, 1 and 9, so 12 and 120 come first (12 is shorter), then 5, then 9: 12, 120, 5, 9.

As integer: 5, 9, 12, 120.

Q8. A postcode field shows 8000 for a source value of 08000. What went wrong, and how do you fix it?

Show answer

The field was stored as a number, which dropped the zero at the start. Change the field to text and import the data again from the source file, so that 08000 is kept in full.

Questions 9 to 12: import and duplicates

Q9. A CSV file has 1 header line and 8 data lines. After import, the table shows 9 records and the first record has the field names as its values. Name the likely cause and the fix.

Show answer

The option first row contains field names was not set, so the header was imported as a record. The correct count is 8. Delete the bad record or re-import with the header option turned on, then check the field types again.

Q10. A CSV line reads: P014,Lee, Anna,45.50 (the name was meant to be one value, Lee, Anna). The table has 3 fields: ID, Name and Fee. What happens on import, and how should the source be written?

Show answer

The comma inside the name is read as a delimiter, so the line splits into 4 values: P014, Lee, Anna and 45.50. They do not fit 3 fields, and Fee may receive the wrong value. The name should be in text qualifiers: P014,“Lee, Anna”,45.50.

Q11. A table of 50 records has every fee set to 20.00. It contains 3 duplicate records. State the fee total shown, the true total and the amount overstated.

Show answer

Shown: 50 × 20.00 = 1000.00. Real records: 50 - 3 = 47, so the true total is 47 × 20.00 = 940.00. Overstated by 1000.00 - 940.00 = 60.00, which also equals 3 × 20.00.

Q12. A table has the primary key MemberID. A member appears as M021 and again as M058 with all other fields identical. Why did the key not stop this, and what should happen next?

Show answer

The key only blocks identical key values. M021 and M058 differ, so both were accepted. Because all other fields match, they are almost certainly one person. Keep the original record (M021, the earlier one), delete M058 and check the record count and totals again.

If you got these wrong

Type of errorQuestionsGo back to
Wrong field type, or text/number confusion at set-upQ1, Q2choosing field types from sample values
Key choice, validation rule or boundary errorQ3, Q4, Q5, Q6defining a key and a validation condition
Import settings, header or comma problemsQ9, Q10importing a small fictional dataset
Wrong sort order, zero lost, totals not workingQ7, Q8detecting an incorrect numeric-text interpretation
Duplicate effects and key limitsQ11, Q12explaining why a duplicate record matters

Record each miss in the mistake log and retest queue so that you retest it later. The read-only SQL practice lab and the ICT practical task and evidence checker give more invented data to examine.

A teacher in online one-to-one ICT tuition can mark your written explanations with you and set new tables for the types of error you made.

Questions people ask

How should I use this practice set?

Cover the answer, write your own response on paper, then open the answer and compare. Write full sentences for the explain questions, as an exam would expect. Mark the questions you missed and revisit the matching lesson before trying fresh data.

Are these questions from past papers?

No. Every question and dataset here is original and invented for practice. Past papers and the syllabus are on the Cambridge ICT 0417 page, and your exam centre or teacher can tell you which papers apply to your year.

Should I use software while practising?

Yes, where you can. Rebuild the small tables in any database or spreadsheet program and test each rule yourself. The ideas here are software-neutral, so the steps may differ in menu names but the reasoning is the same.

Updated:

Your next step

If your answers here are right but slow, or right for the wrong reason, a one-to-one teacher can listen to your explanations and tighten the ones that would lose marks.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80. Other fees, schedules and ongoing arrangements are confirmed directly with your teacher after the trial class.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parent or guardian? Enquire here

9,000+ students helped through our service