Chapter 6 Data Management數據管理
Chapter 6 Data Management 數據管理
Data must be carefully control Ise To get accurate and meaningful result To protect the computer hardware from being damaged
Data must be carefully control because ◼ To get accurate and meaningful result ◼ To protect the computer hardware from being damaged
Sources of error(錯誤來源) ■ Fill in error(填寫錯誤) ■ Transcription error(抄寫錯誤) Input error(輸入錯誤)
Sources of error (錯誤來源) ◼ Fill in error (填寫錯誤) ◼ Transcription error (抄寫錯誤) ◼ Input error (輸入錯誤)
How to control? Data verification(數據核對) Data validation(數據驗證)
How to control? Data verification (數據核對) Data validation (數據驗證)
Data verification(數據核對) Display data to let the user check again and ask for confirm double check ■ Triple check For example: Bill Payment System Ticket Booking System
Data verification (數據核對) ◼ Display data to let the user check again and ask for confirm ◼ Double check ◼ Triple check ◼ ……. ◼ For example : Bill Payment System, Ticket Booking System
Data validation(數據驗證) Programmer foresee possible errors and detect them and probably correct them Presence check- this field must be filled a Range check -Data exceed a limit? Type check -Data type match or not? a Consistency check-Strange data appear Control total -total no of record correct?
Data validation (數據驗證) ◼ Programmer foresee possible errors and detect them and probably correct them ◼ Presence check - This field must be filled? ◼ Range check - Data exceed a limit? ◼ Type check - Data type match or not? ◼ Consistency check - Strange data appear? ◼ Control total - total no. of record correct?
Data validation(數據驗證) Check digit Can be found in id card bar codes isbn Use formula to check the data is correct or not For example: this student ID 1234(0)correct Formula: Add all digit, Divide the sum by 10, Found the remainder In this case, this is a valid(有效)ID!!
Data validation (數據驗證) ◼ Check digit ◼ Can be found in ID card, bar codes, ISBN … ◼ Use formula to check the data is correct or not ◼ For example : this student ID 1234(0) correct? ◼ Formula : Add all digit, Divide the sum by 10, Found the remainder ◼ In this case, this is a valid (有效) ID !!
Common used checking method Weighted modulo 11 Check Formula unit digit x 2 tenth digit x 3 hundredth digit x4 add all mod 11, use 11- the remainder
Common used checking method ◼ Weighted modulo 11 check ◼ Formula : ◼ unit digit X 2 ◼ tenth digit X 3 ◼ hundredth digit X 4 ◼ : ◼ add all, mod 11, use 11 - the remainder
HK ID No Checking A237637(A X8 X7X6 X5 X4X3X9 8+14+18÷35+24+9+14 check digit=11=10i72有效! 122 122mod1l=1
HK ID No Checking 297138(0 X8 X7X6 X5 X4X3X9 208+14+54+35+4+9性6 check digit11-10= 1 It isinvalidt無数 340 340m11=10