| Goal | Find base table columns that have an enumerated type that seems to emulate Boolean type. |
|---|---|
| Notes | Query checks as to whether an enumerated type has at least one label that name contains true,false,yes,no,on,off,jah,ei,unkn and whether the type has two or three labels. The query returns labels (as an array) as well as an array of identifiers of columns (schema_name.table_name.column_name) that have the type. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | High (Few or no false-positive results) |
| License | MIT (opens in new tab) |
| Fixing Suggestion | Specify for each column a right data type that takes into account expected values in the column. Use BOOLEAN type instead of emulating it based on an enumerated type. Change the type of the column to BOOLEAN. Drop the enumerated type. |
| 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:
Boolean data
Queries of this category provide information about truth-values data that is kept in the database.
Data types
Queries of this category provide information about the data types and their usage.
Domains
Queries of this category provide information about reusable specifications of column properties.
User-defined types
Queries of this category provide information about user-defined types in the database.
Validity and completeness
Queries of this category provide information about whether database design represents the world (domain) correctly (validity) and whether database design captures all the information about the world (domain) that is correct and relevant (completeness).
| Name | Description |
|---|---|
| Boolean data | Queries of this category provide information about truth-values data that is kept in the database. |
| Data types | Queries of this category provide information about the data types and their usage. |
| Domains | Queries of this category provide information about reusable specifications of column properties. |
| User-defined types | Queries of this category provide information about user-defined types in the database. |
| Validity and completeness | Queries of this category provide information about whether database design represents the world (domain) correctly (validity) and whether database design captures all the information about the world (domain) that is correct and relevant (completeness). |