Data Validation (資料驗證):
1. Field presence check (完整性檢查)
Function: Ensure that all necessary fields are present.
Example: The student number must be included in the student record.
2. Field length check (欄長度檢查)
Function: Ensure that the data has the correct number of characters or digits.
Example: A domestic telephone number in Hong Kong must have 8 digits.
3. Range check (範圍檢查)
Function: Ensure that the data value is within a pre-determined range.
Example: The mark of a test should range from 0 to 100.
4. Fixed value check (一致性檢查)
Function: Ensure that the data conforms to be one of the values in a predefined list.
Example: The gender of a student must be either 'Male' or 'Female'.
5. Format check (數據類型(格式)檢查)
Function: Ensure that the form of data follows some known patterns.
Example: The e-mail address must be a combination of a user name and a domain name with the symbol '@' in between.
6. Type check
Function: Ensure that the data types are correct.
Example: The students' examination marks should be numbers but not characters, while their names should be characters but not numbers.
7. Check digit (檢查數位)
Function: It is used for self-checking. With numeric data, a check digit is calculated using a mathematical formula and this is then attached to the end of the number. When the check digit of the number matches the digit calculated from the number, the number is confirmed valid.
Parity check is a common application of check digit in digital data transmission.
Example: 1. The check digit of ISBN.
2. Our H.K. I.D. card number.