Data validation can take many different shapes. The vast majority of validation processes will perform a few of these tests to make sure the data is correct before being placed in the database. Data validation checks of common types include:
Verifying Data Type
A data type check is used to confirm that the entered data is of the correct data type. For instance, a field might only take numerical data. If so, any data that contains extra characters, including such letters or special symbols, should be rejected by the system.
Coding Check
A code check ensures that a column is selected from a valid value list or that it complies with particular formatting requirements. For instance, it is easier to verify if a postal code is valid when compared to a list of valid codes. The same can be said for other things like country codes as well as NAICS industry codes.
Span Check
Range checking will reveal if the input data fits inside a specific range. For instance, geographic data typically uses latitude and longitude. A latitude value's range seems to be from -90 to 90, and a longitude value's range is the one from -180 to 180. Any values beyond this range are invalid.
Verify the format
Many data types follow a predefined format. A common use case is for date columns having a fixed style, including such "YYYY-MM-DD" or "DD-MM-YYYY." A data validation procedure that ensures dates are written correctly makes it simpler to maintain consistency throughout time and across data.
Examine consistency
Consistency checks, a type of logic check, confirm that the data was supplied in a logically consistent manner. An example is deciding whether a package's delivery date is later than its shipment date.
The Test for Uniqueness
Some information is by definition unique, such as IDs or email addresses. These database fields should most likely all have distinct entries. A database item cannot be inserted more than once, thanks to a uniqueness check.