| Goal | This query performs an intra-table analysis to detect potential schema ambiguities. It identifies pairs of columns within the same table that exhibit both high textual similarity and structural equivalence. Specifically, it flags pairs where the names have a Levenshtein edit distance of exactly one and the columns share the same data type or domain. This combination suggests a high probability of typographical errors (e.g., status vs statuss), inconsistent naming (singular vs. plural), or improper denormalization (e.g., item1 vs item2), all of which undermine schema clarity. |
|---|---|
| Notes | The query uses a function from the fuzzystrmatch extension. The query removes digits from the names before the comparison, i.e., the result does not contain the pairs like col1 and col2. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Low (Many false-positive results) |
| License | MIT (opens in new tab) |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Categories
This query is classified under the following categories:
Naming
Queries of this category provide information about the style of naming.
| Name | Description |
|---|---|
| Naming | Queries of this category provide information about the style of naming. |