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.

#341. Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version)

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#342. CHECK constraint cardinality is zero

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#343. CHECK constraints on columns with Boolean data

INFORMATION_SCHEMA only

Find check constraints that involve columns with the type Boolean.

General License: MIT (opens in new tab)

#344. CHECK constraints on columns with temporal data

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#345. CHECK constraints that perhaps do not consider 'infinity' and '-infinity' special values

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#346. CHECK constraints that perhaps incorrectly consider 'infinity' and '-infinity' special values

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#347. CHECK constraints that use non-deterministic functions

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#348. CHECK constraints with the cardinality bigger than one

system catalog base tables only

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 License: MIT (opens in new tab)

#349. CHECK constraints with the cardinality bigger than one that involve the same set of columns

system catalog base tables only

CHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.

General License: MIT (opens in new tab)

#350. CHECKs are associated with a column instead of the domain of the column

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#351. Column name contains the table name

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#352. Column name is the same as the table name

INFORMATION_SCHEMA+system catalog base tables

Find columns that have the same name as the table. The names may have different uppercase/lowercase characters. Sometimes columns with such names are used as the key columns. Make sure that the naming style is consistent.

General License: MIT (opens in new tab)

#353. Columns defined in a subtable

INFORMATION_SCHEMA+system catalog base tables

Find columns that have been added to a subtable, i.e., these were not defined in its immediate supertable.

General License: MIT (opens in new tab)

#354. Columns for registration and update times

INFORMATION_SCHEMA only

Find base table columns that based on the names and data types are meant for registering registration time or update time. Make sure that the columns have the same properties.

General License: MIT (opens in new tab)

#355. Columns of base tables that hold truth values but do not have a default value (Boolean columns)

INFORMATION_SCHEMA only

Find columns of base tables that have type BOOLEAN but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. Often it should be possible to select one of these as the default value of a column that has BOOLEAN type.

Problem detection License: MIT (opens in new tab)

#356. Columns of base tables that hold truth values but do not have a default value (non-Boolean columns)

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#357. Columns of base tables that hold truth values but do not restrict the permitted values (non-Boolean columns)

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#358. Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns)

INFORMATION_SCHEMA only

Find columns of base tables that have type BOOLEAN. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.

Problem detection License: MIT (opens in new tab)

#359. Columns of base tables that hold truth values that do not have a default value although they could have it (non-Boolean columns)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables that do not have type BOOLEAN but are used to record Boolean values. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.

Problem detection License: MIT (opens in new tab)

#360. Columns of base tables with data about postal addresses, file addresses, or web addresses that have an incorrect data type

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register file/web addresses. Find the columns where the type refers to the possibility that values in the column are actual files.

Problem detection License: MIT (opens in new tab)
# Name Goal Type Data source Last update (sorted descending) License Actions
341 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 (opens in new tab)
342 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 (opens in new tab)
343 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 (opens in new tab)
344 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 (opens in new tab)
345 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 (opens in new tab)
346 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 (opens in new tab)
347 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 (opens in new tab)
348 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 (opens in new tab)
349 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 (opens in new tab)
350 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 (opens in new tab)
351 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 (opens in new tab)
352 Column name is the same as the table name Find columns that have the same name as the table. The names may have different uppercase/lowercase characters. Sometimes columns with such names are used as the key columns. Make sure that the naming style is consistent. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
353 Columns defined in a subtable Find columns that have been added to a subtable, i.e., these were not defined in its immediate supertable. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
354 Columns for registration and update times Find base table columns that based on the names and data types are meant for registering registration time or update time. Make sure that the columns have the same properties. General INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
355 Columns of base tables that hold truth values but do not have a default value (Boolean columns) Find columns of base tables that have type BOOLEAN but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. Often it should be possible to select one of these as the default value of a column that has BOOLEAN type. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
356 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)
357 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)
358 Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns) Find columns of base tables that have type BOOLEAN. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
359 Columns of base tables that hold truth values that do not have a default value although they could have it (non-Boolean columns) Find columns of base tables that do not have type BOOLEAN but are used to record Boolean values. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
360 Columns of base tables with data about postal addresses, file addresses, or web addresses that have an incorrect data type Find base table columns that name refers to the possibility that these are used to register file/web addresses. Find the columns where the type refers to the possibility that values in the column are actual files. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)