Filter 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 the relatively small amount of data in the system catalog of a database.
#401. CHAR columns have a default value that length is shorter from the character maximum length of the column
INFORMATION_SCHEMA onlyChoose a suitable data type, field size, and default value. If the default value is shorter from the character maximum length, then spaces will be added to the end of the registered value.
#402. CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the column
INFORMATION_SCHEMA onlyFind table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces).
#403. Check as to wheteher the names of columns are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming.
#404. Check as to wheteher the names of columns are in the plural or in the singular form (English version) (aggregate view)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of columns that name is in plural or in singular by table type.
#405. Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#406. Check as to wheteher the names of parameters are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#407. Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#408. Check as to wheteher the names of tables are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#409. Check as to wheteher the names of tables are in the plural or in the singular form (English version) (aggregate view)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of tables that name is in plural or in singular by table type.
#410. Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#411. CHECK constraint cardinality is zero
INFORMATION_SCHEMA+system catalog base tablesWrite correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE.
#412. CHECK constraints on columns with Boolean data
INFORMATION_SCHEMA onlyFind check constraints that involve columns with the type Boolean.
#413. CHECK constraints on columns with temporal data
INFORMATION_SCHEMA onlyIf your table contains columns with temporal data, then it will be appropriate to restrict the range of possible values in these columns because some of the values that belong to the type might not be appropriate (for instance, imagine a client who was born in 1100-12-03 or a contract that was registered in 3890-12-12- 12:45). If your table contains multiple columns with temporal data that denote events, then the rule about the order of the events must be enforced, if possible.
#414. CHECK constraints that perhaps do not consider 'infinity' and '-infinity' special values
INFORMATION_SCHEMA+system catalog base tablesFind check constraints of base tables that cover exactly one column where the default value of the column is special value 'infinity' or '-infinity'. Find only such constraints that probably check a range of permitted values but do not consider that one of the values might be 'infinity' or '-infinity'. Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION.
#415. CHECK constraints that perhaps incorrectly consider 'infinity' and '-infinity' special values
INFORMATION_SCHEMA+system catalog base tablesSuch special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. No value can be bigger than infinity or smaller than -infinity. If the check constraint cheks that a value must be bigger than -infinity or smaller than infinity, then it does not restrict (almost) anything.
#416. CHECK constraints that use non-deterministic functions
INFORMATION_SCHEMA onlyDiscover incorrect usage of non-deterministic functions in CHECK constraints. Find base table columns and foreign table columns that have a CHECK constraint that refers to a non-deterministic function that returns current date/time/timestamp.
#417. CHECK constraints with the cardinality bigger than one
system catalog base tables onlyFind multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger.
#418. CHECK constraints with the cardinality bigger than one that involve the same set of columns
system catalog base tables onlyCHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.
#419. CHECKs are associated with a column instead of the domain of the column
INFORMATION_SCHEMA+system catalog base tablesFind simple check constraints (involve one column) that are associated with a base table column instead of the domain of the column. Common checks of data in columns that share the same domain should be described at the level of domain not at the level of columns.
#420. Column name contains the table name
INFORMATION_SCHEMA+system catalog base tablesFind columns that have the same name as the table. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.
| # | Name(activate to sort ascending) | Goal(activate to sort ascending) | Type(activate to sort ascending) | Data source(activate to sort ascending) | Last update(sorted descending, activate to sort ascending) | License | Actions |
|---|---|---|---|---|---|---|---|
| 401 | CHAR columns have a default value that length is shorter from the character maximum length of the column | Choose a suitable data type, field size, and default value. If the default value is shorter from the character maximum length, then spaces will be added to the end of the registered value. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View | |
| 402 | CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the column | Find table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces). | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View | |
| 403 | Check as to wheteher the names of columns are in the plural or in the singular form (English version) | Check as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 404 | Check as to wheteher the names of columns are in the plural or in the singular form (English version) (aggregate view) | Check as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of columns that name is in plural or in singular by table type. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 405 | Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 406 | Check as to wheteher the names of parameters are in the plural or in the singular form (English version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 407 | Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 408 | Check as to wheteher the names of tables are in the plural or in the singular form (English version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 409 | Check as to wheteher the names of tables are in the plural or in the singular form (English version) (aggregate view) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of tables that name is in plural or in singular by table type. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 410 | Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 411 | CHECK constraint cardinality is zero | Write correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 412 | CHECK constraints on columns with Boolean data | Find check constraints that involve columns with the type Boolean. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View | |
| 413 | CHECK constraints on columns with temporal data | If your table contains columns with temporal data, then it will be appropriate to restrict the range of possible values in these columns because some of the values that belong to the type might not be appropriate (for instance, imagine a client who was born in 1100-12-03 or a contract that was registered in 3890-12-12- 12:45). If your table contains multiple columns with temporal data that denote events, then the rule about the order of the events must be enforced, if possible. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View | |
| 414 | CHECK constraints that perhaps do not consider 'infinity' and '-infinity' special values | Find check constraints of base tables that cover exactly one column where the default value of the column is special value 'infinity' or '-infinity'. Find only such constraints that probably check a range of permitted values but do not consider that one of the values might be 'infinity' or '-infinity'. Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 415 | CHECK constraints that perhaps incorrectly consider 'infinity' and '-infinity' special values | Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. No value can be bigger than infinity or smaller than -infinity. If the check constraint cheks that a value must be bigger than -infinity or smaller than infinity, then it does not restrict (almost) anything. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 416 | CHECK constraints that use non-deterministic functions | Discover incorrect usage of non-deterministic functions in CHECK constraints. Find base table columns and foreign table columns that have a CHECK constraint that refers to a non-deterministic function that returns current date/time/timestamp. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View | |
| 417 | CHECK constraints with the cardinality bigger than one | Find multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger. | General | system catalog base tables only | MIT (opens in new tab) | View | |
| 418 | CHECK constraints with the cardinality bigger than one that involve the same set of columns | CHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication. | General | system catalog base tables only | MIT (opens in new tab) | View | |
| 419 | CHECKs are associated with a column instead of the domain of the column | Find simple check constraints (involve one column) that are associated with a base table column instead of the domain of the column. Common checks of data in columns that share the same domain should be described at the level of domain not at the level of columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View | |
| 420 | Column name contains the table name | Find columns that have the same name as the table. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View |