Filter Queries
Found 1053 queries.
- All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
- Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
- Statistics about the catalog content and project home in GitHub that has additional information.
#1. Age columns in base and foreign tables
INFORMATION_SCHEMA onlyThis query identifies columns in base and foreign tables that are intended to store age values. It detects these fields by analyzing both their naming conventions and data types.
#2. All CHECK constraints of domains that are not associated with any table
INFORMATION_SCHEMA onlyFind all CHECK constraints (except NOT NULL) of domains that are not associated with any column.
#3. All column DEFAULT values
INFORMATION_SCHEMA onlyFind all the default values of base table, view, and foreign table columns.
#4. All column dynamic DEFAULT values values that do not invoke a sequence
INFORMATION_SCHEMA onlyFind all columns that have a dynamic default value, i.e., the value is returned by a function but the function is not for invoking a sequence.
#5. All columns of a base table have a default value
INFORMATION_SCHEMA onlyFind base tables where all the columns have a default value.
#6. All column static DEFAULT values
INFORMATION_SCHEMA onlyFind all columns that have a static default value, i.e., the value is not returned by a function.
#7. All domain default values
INFORMATION_SCHEMA onlyFind domains that specify a default values and columns that are defined based on the domain. Make sure that there are no unsuitable default values.
#9. All foreign tables
INFORMATION_SCHEMA onlyFind all foreign tables.
#10. All table CHECK constraints that cover at leat one column
INFORMATION_SCHEMA onlyFind all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).
#11. All the non-primary key columns are optional
INFORMATION_SCHEMA onlyFind base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements.
#12. All user schemas
INFORMATION_SCHEMA onlyFind all the schemas in the database that are not used for the system purposes.
#13. Base table column name is the same as its domain name
INFORMATION_SCHEMA onlyFind base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these.
#14. Base table column of comments/descriptions has an incorrect data type or maximum character length
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values.
#15. Base table column of measurements does not have a correct data type
INFORMATION_SCHEMA onlyThis query identifies a semantic mismatch in data type selection for columns intended to store measurement data. It targets columns whose names imply a quantitative measurement (e.g., "length", "weight", "count", excluding boolean prefixes like "is_") but are not defined with a numeric data type (INTEGER, NUMERIC, etc.). Storing measurements as text (VARCHAR) prevents mathematical operations, aggregation, and proper sorting, and is considered a design flaw.
#16. Base table column of national identification numbers does not have a correct data type
INFORMATION_SCHEMA onlyFind non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers.
#17. Base table column of personal names has questionable properties
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account.
#18. Base table column of quantities does not have a numeric type (based on column names)
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type.
#19. Base table column of sums of money does not have a numeric type (based on column names)
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type.
#20. Base table column of sums of money has too big or small scale
INFORMATION_SCHEMA onlyFind base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column.
| # | Name | Goal | Type | Data source (sorted ascending) | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 1 | Age columns in base and foreign tables | This query identifies columns in base and foreign tables that are intended to store age values. It detects these fields by analyzing both their naming conventions and data types. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 2 | All CHECK constraints of domains that are not associated with any table | Find all CHECK constraints (except NOT NULL) of domains that are not associated with any column. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 3 | All column DEFAULT values | Find all the default values of base table, view, and foreign table columns. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 4 | All column dynamic DEFAULT values values that do not invoke a sequence | Find all columns that have a dynamic default value, i.e., the value is returned by a function but the function is not for invoking a sequence. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 5 | All columns of a base table have a default value | Find base tables where all the columns have a default value. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 6 | All column static DEFAULT values | Find all columns that have a static default value, i.e., the value is not returned by a function. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 7 | All domain default values | Find domains that specify a default values and columns that are defined based on the domain. Make sure that there are no unsuitable default values. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 8 | All domains | Find all domains. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 9 | All foreign tables | Find all foreign tables. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 10 | All table CHECK constraints that cover at leat one column | Find all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications). | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 11 | All the non-primary key columns are optional | Find base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 12 | All user schemas | Find all the schemas in the database that are not used for the system purposes. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 13 | Base table column name is the same as its domain name | Find base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 14 | Base table column of comments/descriptions has an incorrect data type or maximum character length | Find base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 15 | Base table column of measurements does not have a correct data type | This query identifies a semantic mismatch in data type selection for columns intended to store measurement data. It targets columns whose names imply a quantitative measurement (e.g., "length", "weight", "count", excluding boolean prefixes like "is_") but are not defined with a numeric data type (INTEGER, NUMERIC, etc.). Storing measurements as text (VARCHAR) prevents mathematical operations, aggregation, and proper sorting, and is considered a design flaw. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 16 | Base table column of national identification numbers does not have a correct data type | Find non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 17 | Base table column of personal names has questionable properties | Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 18 | Base table column of quantities does not have a numeric type (based on column names) | Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 19 | Base table column of sums of money does not have a numeric type (based on column names) | Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 20 | Base table column of sums of money has too big or small scale | Find base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) |