| Goal | Find simple primary keys that column name does not contain the table name. The naming should be clear and consistent. |
|---|---|
| Notes | The query excludes primary key columns that are also foreign key columns because the name of these columns could be derived based on another (referenced) table. |
| 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) |
| Fixing Suggestion | Rename the column so that the column name contains the table name. |
| Data Source | system catalog only |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems about names
A selection of queries that return information about the names of database objects. Contains all the types of queries - problem detection, software measure, and general overview.
| Name | Description |
|---|---|
| Find problems about names | A selection of queries that return information about the names of database objects. Contains all the types of queries - problem detection, software measure, and general overview. |
Categories
This query is classified under the following categories:
Inconsistencies
Queries of this catergory provide information about inconsistencies of solving the same problem in different places.
Naming
Queries of this category provide information about the style of naming.
Uniqueness
Queries of this category provide information about uniqueness constraints (PRIMARY KEY, UNIQUE, EXCLUDE) as well as unique indexes.
| Name | Description |
|---|---|
| Inconsistencies | Queries of this catergory provide information about inconsistencies of solving the same problem in different places. |
| Naming | Queries of this category provide information about the style of naming. |
| Uniqueness | Queries of this category provide information about uniqueness constraints (PRIMARY KEY, UNIQUE, EXCLUDE) as well as unique indexes. |