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.
#441. Base table columns permitting e-mail addresses without @ sign
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited.
#442. Base table columns permitting negative prices/quantity
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited.
#443. Base table columns permitting URLs without a protocol
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited.
#444. Columns of base tables that hold truth values but do not have a default value (non-Boolean columns)
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It could be possible to select one of these as the default value in case of the columns.
#445. Columns of base tables that hold truth values but do not restrict the permitted values (non-Boolean columns)
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a have a check constraint. The constraint should restrict the permitted values with values that represent truth values TRUE and FALSE.
#446. Three-valued logic (non-Boolean columns)
INFORMATION_SCHEMA+system catalog base tablesFind non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the columns mandatory.
#447. Overlapping non-function based indexes that have the same leading column with the same operator class
system catalog base tables onlyFind non-function based indexes (both unique and non-unique) that duplicate each other because their first column is identical and the operator class that is used in case of the first column is identical. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.
#448. Overlapping non-function based indexes that have the same leading column but with different operator class
system catalog base tables onlyFind non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.
#449. Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not
INFORMATION_SCHEMA+system catalog base tablesFind non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent.
#450. Pairs of non-key column name and type pairs that have in different base tables a different default value
INFORMATION_SCHEMA+system catalog base tablesFind non-key base table columns with the same name and type that have different default values. Be consistent. Columns with the same name and type shouldn't probably have different default values in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)
#451. Pairs of non-key column name and type pairs that have in some base tables a default value and some cases not
INFORMATION_SCHEMA+system catalog base tablesFind non-key base table columns with the same name and type that have in some cases a default value and some cases not. Be consistent. Columns with the same name and type should probably either always have a default value in case of different tables or never have a default value in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)
#452. Lifecycle not initiated
INFORMATION_SCHEMA+system catalog base tablesFind non-primary key and non-unique base table foreign key columns that name refers to the possibility that these are used to register references to a state classifier. The column must belong to a foreign key and does not have a default value.
#453. Perhaps excessive privileges to use views
INFORMATION_SCHEMA+system catalog base tablesFind non-SELECT privileges to use views (for others than the owner of the view). Perhaps there should be only the privilege to make queries (SELECT statements based on the views) and data modification takes place by using routines. REFERENCES and TRIGGER privileges are definitely not needed.
#454. Database connect privilege is missing
INFORMATION_SCHEMA+system catalog base tablesFind non-superusers who have a privilege to use a table or a routine but do not have the privilege to connect to the database.
#455. 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.
#456. NOT VALID foreign key constraints
system catalog base tables onlyFind not valid foreign key constraints. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint.
#457. One-to-one relationships
system catalog base tables onlyFind one-to-one relationships between base tables. In this case the foreign key columns must have primary key or unique constraint. These tables could implement inheritance hierarchy that has been specified in the conceptual data model.
#458. Optional base table columns
INFORMATION_SCHEMA onlyFind optional base table columns, i.e., columns that permit NULLs. Are you sure you want to allow NULLs in these columns?
#459. Optional non-foreign key base table columns that participate in a UNIQUE constraint or index
INFORMATION_SCHEMA+system catalog base tablesFind optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.
#460. Optional base table columns that participate in a UNIQUE constraint or index
INFORMATION_SCHEMA+system catalog base tablesFind optional base table columns that participate in a UNIQUE constraint or index. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.
| # | Name | Goal (sorted ascending) | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 441 | Base table columns permitting e-mail addresses without @ sign | Find non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 442 | Base table columns permitting negative prices/quantity | Find non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 443 | Base table columns permitting URLs without a protocol | Find non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 444 | Columns of base tables that hold truth values but do not have a default value (non-Boolean columns) | Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It could be possible to select one of these as the default value in case of the columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 445 | Columns of base tables that hold truth values but do not restrict the permitted values (non-Boolean columns) | Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a have a check constraint. The constraint should restrict the permitted values with values that represent truth values TRUE and FALSE. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 446 | Three-valued logic (non-Boolean columns) | Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the columns mandatory. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 447 | Overlapping non-function based indexes that have the same leading column with the same operator class | Find non-function based indexes (both unique and non-unique) that duplicate each other because their first column is identical and the operator class that is used in case of the first column is identical. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 448 | Overlapping non-function based indexes that have the same leading column but with different operator class | Find non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 449 | Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases not | Find non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 450 | Pairs of non-key column name and type pairs that have in different base tables a different default value | Find non-key base table columns with the same name and type that have different default values. Be consistent. Columns with the same name and type shouldn't probably have different default values in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 451 | Pairs of non-key column name and type pairs that have in some base tables a default value and some cases not | Find non-key base table columns with the same name and type that have in some cases a default value and some cases not. Be consistent. Columns with the same name and type should probably either always have a default value in case of different tables or never have a default value in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 452 | Lifecycle not initiated | Find non-primary key and non-unique base table foreign key columns that name refers to the possibility that these are used to register references to a state classifier. The column must belong to a foreign key and does not have a default value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 453 | Perhaps excessive privileges to use views | Find non-SELECT privileges to use views (for others than the owner of the view). Perhaps there should be only the privilege to make queries (SELECT statements based on the views) and data modification takes place by using routines. REFERENCES and TRIGGER privileges are definitely not needed. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 454 | Database connect privilege is missing | Find non-superusers who have a privilege to use a table or a routine but do not have the privilege to connect to the database. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 455 | 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) | |
| 456 | NOT VALID foreign key constraints | Find not valid foreign key constraints. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 457 | One-to-one relationships | Find one-to-one relationships between base tables. In this case the foreign key columns must have primary key or unique constraint. These tables could implement inheritance hierarchy that has been specified in the conceptual data model. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 458 | Optional base table columns | Find optional base table columns, i.e., columns that permit NULLs. Are you sure you want to allow NULLs in these columns? | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 459 | Optional non-foreign key base table columns that participate in a UNIQUE constraint or index | Find optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 460 | Optional base table columns that participate in a UNIQUE constraint or index | Find optional base table columns that participate in a UNIQUE constraint or index. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |