Learning Objectives
By the end of this chapter, you will be able to:
- Build the hierarchy character to database without mixing levels.
- Pick a primary key and correct data type for each field.
- Separate data, information, and knowledge with a BBA example.
- Test a table for accuracy, completeness, consistency, timeliness, relevance, validity.
- Size a cooperative or bank file on 2081 BS with storage and error cost.
Data hierarchy
Facts are stored in layers. Each layer groups the one below.
flowchart BT
C[Character] --> F[Field]
F --> R[Record]
R --> FI[File or Table]
FI --> D[Database]
| Layer | What it is | Example | View |
|---|---|---|---|
| Bit and byte | 0 or 1, 8 bits is one byte | A as 01000001 |
Physical |
| Character | One letter, digit, symbol | S |
Atom |
| Field | Related characters as one attribute | Sita Sharma for Name |
Column |
| Record | Related fields for one entity | Row 1023, Sita Sharma, BBA, 2nd sem, 9841XXXXXX | Row |
| File or table | Related records | Members table with 1,200 rows | Table |
| Database | Related files managed together | Members plus Loans plus Repayments | System |
Row is record, column is field.
Keys and types
| Concept | Rule | Good pick | Poor pick |
|---|---|---|---|
| Primary key | Unique, never empty, never duplicated | Member ID, PAN, Customer ID, Roll | Name, phone, address |
| Data type | Declares what the field may hold | PAN as text, amount as number, dob as date, fee paid as boolean | Text for dob, number for phone |
Phone is text, not number. You never add phones and must keep leading zero. PAN is text for the same reason.
| Roll or ID as key | Name | Product | Group | Contact as text |
|---|---|---|---|---|
| 1023 | Sita Sharma | Saving | Group A | 9841XXXXXX |
| 1024 | Ram Thapa | Loan | Group B | 9851XXXXXX |
Same pattern holds for a bank customer file or an IRD PAN register.
Data, information, knowledge
Raw facts become useful only after processing.
flowchart LR
D[Data: raw] --> I[Information: in context]
I --> K[Knowledge: guides decision]
| Layer | Nature | Answers | Cooperative example |
|---|---|---|---|
| Data | Raw fact | What is recorded | 120, 2081-11-10 |
| Information | Data in context | What happened | 120 loans disbursed this week |
| Knowledge | Pattern plus action | What to do | Disbursement up 20 percent after field visits, so add one visit per ward |
| Aspect | Data | Information | Knowledge |
|---|---|---|---|
| Meaning | Little alone | Meaningful | Guides choice |
| Form | 85, 72, 91 | Average 82.7 | Follow up improves repayment, so keep it |
| User | Recorder | Analyst | Manager |
A manager acts on knowledge built from clean data.
Good data
Good data passes a test. Garbage in remains garbage out.
| Characteristic | Test | Symptom if failed |
|---|---|---|
| Accurate | Matches real world | Interest to wrong account |
| Complete | No missing required field | Loan row without PAN cannot file to IRD |
| Consistent | Same fact equal everywhere | Address differs in Members and Loans |
| Timely | Up to date when needed | Rate change of 2081-10-15 applied on 2081-11-30 |
| Relevant | Serves the decision | Favourite colour for a loan |
| Valid | Format and range correct | Future birth date, letters in phone |
| Unique | No duplicate entity | One member with two IDs splits history |
| Auditable | Source and time logged | IRD asks who edited and there is no log |
Check any table with those rows.
Self-check
Nepal worked example: cooperative file on 2081-11-16 (NPR)
A Lalitpur cooperative holds 1,800 members. On 2081-11-16 it cleans the file before IRD filing on 2081-11-30. Each record is 520 bytes.
- Size = 1,800 times 520 = 936,000 bytes, about 0.89 MB. With indexes plus 30 percent about 1.2 MB. Storage is not the issue, error is.
- Scan finds 38 without PAN, 14 duplicate phones, 9 addresses that differ between Members and Loans, 6 future dates of birth. 67 defective rows, 3.7 percent.
- Cost if dirty: IRD re-upload Rs 1,500 plus rework. 67 times 20 minutes = 22.3 hours at Rs 400 = Rs 8,920 plus Rs 1,500 = Rs 10,420. A control that forces PAN as 9 digit text and blocks future dates costs Rs 3,000 once.
- Fix: Member ID as primary key, PAN and phone as text, validity on dob before today, unique on PAN, consistency check on address.
Decision: do not buy disk, buy fewer defective rows. Duplicate citizenship splits credit history.
Example: On 2081-11-16 treat each field as an audit note. Does the key block two IDs for one member, does PAN block letters and future dates, is there a log of who changed a balance and when.
Summary
- Hierarchy is character to database, on bits and bytes.
- Primary key identifies the row, type guards the field, phone and PAN stay text.
- Data is raw, information is context, knowledge guides action.
- Good data is accurate, complete, consistent, timely, valid, unique, auditable.
Key Takeaways
- Record is row, field is column.
- Name is no key because names repeat.
- Size is trivial, error cost is not. Budget validation first.
Discussion Questions
- Why must phone and PAN be text even when they look numeric?
- Give a local example where one fact has two values in two tables. Which characteristic fails?
- How does a primary key cut duplicate loan IDs more than a manual check?
Exercises
Short answer
- Define field, record, and file with one line example each.
- Why can name not be a primary key? Name two fields that can.
- Separate data from information from knowledge with one trio.
Long answer
- Explain the hierarchy with a table from character to database, using 1,800 members at 520 bytes each, name keys and types, and explain why phone is text.
- Explain data, information, and knowledge and list characteristics of good data with a test each. Use the Lalitpur scan on 2081-11-16 with 67 defective rows to compute defect rate and Rs 10,420 rework, and propose constraints that block that class.


