Chapter 2. Validation
Validation is the property of a data element to be shown to be syntactically correct by simple inspection. The major methods are:
1. Table look-up
2. Check digits and other mathematical computations
3. Patterns and regular expressions
The application program can perform a relatively simple operation and spot invalid inputs. The back end (the database engine) must also do the same simple calculation on the columns in a database, just in case someone gets data directly into the tables with a tool or other application. While this sounds like a “belt and suspenders (braces, galluses)” approach, you can write the database side code to favor clean data for performance. Even without front end edits in the application programs and other ...

Get Joe Celko's Data, Measurements and Standards 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.