Key Facts
- Category
- Data & Tables
- Input Types
- textarea, number, select, checkbox
- Output Type
- text
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The Foreign Key Validator is a specialized utility designed to ensure referential integrity by comparing primary and foreign key relationships across datasets. It helps identify missing keys, orphaned records, and inconsistencies, ensuring your relational data remains accurate and reliable during migrations or routine audits.
When to Use
- •Verifying data integrity before or after a database migration.
- •Identifying orphaned records in child tables that lack a corresponding parent entry.
- •Performing cross-table consistency checks to ensure relational mapping is accurate.
How It Works
- •Paste your parent table data into the Primary Key Data field and specify the column index containing the primary keys.
- •Paste your child table data into the Foreign Key Data field and specify the column index containing the foreign keys.
- •Select your preferred validation mode and output format, then run the tool to generate a detailed report of matches and discrepancies.
Use Cases
Examples
1. Validating Customer Orders
Data Analyst- Background
- An analyst needs to ensure that every order in the 'Orders' table is linked to a valid customer ID in the 'Customers' table.
- Problem
- Some orders contain customer IDs that no longer exist in the master customer list.
- How to Use
- Paste the Customer list into Primary Key Data (Column 1) and the Orders list into Foreign Key Data (Column 3). Select 'Find Missing Keys Only'.
- Example Config
-
primaryKeyColumn: 1, foreignKeyColumn: 3, validationMode: 'missing' - Outcome
- A list of order records that reference non-existent customer IDs, allowing for quick cleanup.
2. Cleaning Orphaned Records
Database Administrator- Background
- A legacy database migration resulted in several orphaned records in the 'Transactions' table.
- Problem
- Need to identify and remove transactions that do not have a corresponding account ID.
- How to Use
- Upload both datasets and set the validation mode to 'orphans' to isolate the invalid entries.
- Example Config
-
validationMode: 'orphans', outputFormat: 'csv' - Outcome
- A CSV file containing all orphaned transaction rows, ready for deletion or reconciliation.
Try with Samples
data-processingRelated Hubs
FAQ
What is an orphaned record?
An orphaned record is a row in a child table that references a primary key value that does not exist in the parent table.
Can I validate data that is case-sensitive?
Yes, you can toggle the 'Case Sensitive' option to ensure that 'ID-01' and 'id-01' are treated as distinct values.
How do I handle empty cells in my data?
Enable the 'Ignore Empty Values' checkbox to skip null or empty fields during the validation process.
What output formats are supported?
The tool supports Detailed Reports, Summary views, JSON format, and CSV exports for invalid records.
Is there a limit to the number of rows I can validate?
The tool is designed for efficient processing, but performance depends on your browser's memory capacity for very large datasets.