8.2. Check Digits via Tables

You can find a discussion of check digits at http://www.academic.ma.rist.edu/mwa/idsn.htm. The idea is that by making an encoded value a little longer, you can validate it at input time and not have to do an edit in the database. The application program can perform a relatively simple operation and spot invalid inputs. You do this by inspection when you reject a date like 2007-02-31 or a ZIP code like 78727 with a State code of NY instead of TX in the mailing address.

8.2.1. Check Digits Defined

Charles Babbage, the father of the computer, observed in the mid-1800s that an inseparable part of the cost of obtaining data is the cost of verifying its accuracy. The best situation is to exclude bad data on entry so that ...

Get Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.