| Goal | This query identifies derived tables (views and materialized views) whose WHERE clause filters data based on a descriptive name or label (e.g., dname = 'ACCOUNTING') rather than an immutable code or identifier (e.g., deptno = 10 or status_code = 'ACTIVE'). Descriptive names, titles, and labels are designed for human presentation and are inherently mutable—they may change over time due to terminology updates, typo corrections, organizational restructuring, or localization. Hardcoding descriptive names into view predicates creates fragile database logic: if a name is updated in the underlying lookup or base table, the derived table will silently stop matching those rows and return incomplete or empty results without raising an error. |
|---|---|
| Notes | The query considers both column names in Estonian and in English. |
| 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 |
|
Fixing Suggestion
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:
Comfortability of data management
Queries of this category provide information about the means that have been used to make the use or management of database more comfortable and thus, more efficient.
Derived tables
Queries of this category provide information about the derived tables (views, materialized views), which are used to implement virtual data layer.
Result quality depends on names
Queries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results.
| Name | Description |
|---|---|
| Comfortability of data management | Queries of this category provide information about the means that have been used to make the use or management of database more comfortable and thus, more efficient. |
| Derived tables | Queries of this category provide information about the derived tables (views, materialized views), which are used to implement virtual data layer. |
| Result quality depends on names | Queries of this category use names (for instance, column names) to try to guess the meaning of a database object. Thus, the goodness of names determines the number of false positive and false negative results. |