What is formatting and validating field data in database management system? Give an example to illustrate.
5 marks
Question source
- Exam year
- 2079 BS / 2022 AD
- Level
- Gazetted Second Class, Assistant Level (Computer Operator – Prabidhik)
- Paper
- Paper II – Sewa Sambandhit Karya Gyan (Job Based Knowledge)
- Section
- Section B
Model answer
Formatting controls how data looks; Validation controls what data is allowed. Both improve readability and prevent wrong entries in government databases where one wrong digit can misplace salary or citizenship records.
1. Formatting field data: Formatting sets display style without changing stored value. Set in table design → Format property.
Examples in MS-Access:
- Date:
15-Jan-2024vs15/01/2024— same date, different look. - Currency:
50000displays asRs. 50,000.00. - Text:
>forces UPPERCASE,<forces lowercase — useful for names. - Phone: Input mask
09\-999999999shows consistent mobile format.
2. Validating field data: Validation is a rule that rejects invalid data during entry.
Common validation methods:
- Required: Field cannot be left blank. Example: CitizenshipNo = Required Yes.
- Validation Rule: Condition. Example:
>=0 And <=100for Marks;>=18for Age;Like "98*"for Nepali mobile starting with 98. - Validation Text: Message shown on error. Example: “Marks must be 0–100”.
- Input Mask: Fixed pattern. Example:
0000-00-00for YYYY-MM-DD date. - Lookup/List: Choose only from list. Example: Gender = Male/Female/Other; District from 77 districts list.
Illustration:
In a Staff table, set Age field: Validation Rule >=18 And <=60, Validation Text “Age must be 18–60 for service”. If clerk types 15, Access blocks save and shows the message. This prevents under-age entry at the source instead of fixing later in reports.