| Goal | This query identifies junction tables with semantically redundant names, specifically targeting those whose names contain the word "join". The structure of a many-to-many table (typically two foreign keys forming a composite primary key) is inherently declarative of its role as a join mechanism. Including the word "join" in the name is superfluous and violates the principle of naming based on the entity or relationship being modeled, not the implementation detail. |
|---|---|
| Notes | The query considers both column names in English and Estonian. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Medium (Medium number of false-positive results) |
| License | MIT (opens in new tab) |
| Fixing Suggestion | For the tables identified by the query, the recommended action is to rename them to better align with conceptual modeling principles. The preferred approach is to select a name that represents the business relationship or entity being modeled. For instance, a table linking users and roles should be named user_role or role_assignment. If a suitable conceptual name is not readily apparent, a fallback solution is to simply remove the superfluous word "join" from the current name. |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems automatically
Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .
| Name | Description |
|---|---|
| Find problems automatically | Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not . |
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. |