sql_compare_counts
Compare row counts between parent and child tables joined by a foreign key to detect missing or extra records and identify data gaps.
Instructions
Compare row counts between a parent and child table (joined by FK) to detect missing or extra records. Useful for finding data gaps.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"parentTable": "<parentTable>",
"childTable": "<childTable>",
"joinColumn": "<joinColumn>"
},
"name": "sql_compare_counts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| childTable | Yes | Child table (e.g. 'Orders') | |
| joinColumn | Yes | The FK column name that links them (e.g. 'CustomerId') | |
| parentTable | Yes | Parent/reference table (e.g. 'Customers') |