Filter Queries

Found 997 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.

# Name Goal Type Data source Last update License
361 Do not format comma-separated lists (based on default values) Find, based on default values, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table or a foreign table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. Problem detection INFORMATION_SCHEMA only 2023-12-30 10:59 MIT License View
362 Do not format comma-separated lists (based on user data) Find, based on the data that users have recoreded in a database, cases where a multi-valued attribute in a conceptual data model is implemented as a textual column of a base table. Expected values in the column are strings that contain attribute values, separated by commas or other separation characters. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-12 15:02 MIT License View
363 Do not leave out referential constraints (based on composite keys) Try to find missing foreign key constraints. Find columns of base tables that are not covered by any foreign key constraint but belong to a composite key, do not have an associated sequence generator, and have a name that refers to the possibility that these are used to record some kind of codes or id's. Moreover, there must be at least one other base table that has a column with the same name. Such strategy would find missing constraints in tables that implement many-to-many relationship types but which that are not complete "islands" in terms of missing foreign key constraints. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-10-31 19:21 MIT License View
364 Do not leave out the referential constraints (based on adjacency list design) Try to find missing foreign key constraints. Find non-key and non-foreign key columns of base tables that do not have an associated sequence generator, and that name refers to the possibility that the column holds parent identifiers. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-18 11:13 MIT License View
365 Do not leave out the referential constraints (based on classifiers) Find non-key and non-foreign columns of base tables with a textual column and small field size in case of which there is a table with the name that is similar to the column name. Perhaps the table is a classifier table and the column should have a foreign key constraint referencing to the table. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-18 11:14 MIT License View
366 Do not leave out the referential constraints (based on column names) Try to find missing foreign key constraints. Find columns of base tables that are not a part of any primary key, unique, and foreign key constraint, do not have an associated sequence generator, but have a name that reffers to the possibility that these are used to record some kind of codes or id's. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-11-26 16:35 MIT License View
367 Do not leave out the referential constraints (based on column names) (2) Try to find missing foreign key constraints. Find columns of base tables that are not a part of any primary key, unique, and foreign key constraint, but have a name that reffers to the possibility that these are used to record references to a user. Exclude columns that have the default value CURRENT_USER or SESSION_USER. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-12-30 10:29 MIT License View
368 Do not leave out the referential constraints (islands) Try to find missing foreign key constraints. Find base tables that do not participate in any referential constraint (as the referenced table or as the referencing table). These tables are like "islands" in the database schema. Problem detection system catalog base tables only 2021-03-10 12:20 MIT License View
369 Do not leave out the referential constraints (pairs of tables) Try to find missing foreign key constraints. Find pairs of base table columns that have the similar name, perhaps the same type, and that are not associated through a foreign key relationship. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View
370 Do not refer to the table schema in the references to columns Find routines where in SELECT or UPDATE statements references to columns are prefixed with references to the table schema. Referring to schema in this context bloats the code. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 17:32 MIT License View
371 Do not register age as a number Find columns of base and foreign tables that based on the column name and type are used to register age. Problem detection INFORMATION_SCHEMA only 2024-11-06 09:55 MIT License View
372 Do not specify a list of values in a table column definition Find cases where the list of valid data values in the column is specified in the column definition (in addition to specifying the type of the column) by using, for instance, check constraints or enumerated types. The check constraint is either associated directly with a table or is associated with a domain. Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-06-09 14:30 MIT License View
373 Do not use a generic attribute table Find base tables that implement a highly generic database design (EAV design - Entiry-Attribute-Value design), according to which attribute values are recorded in a generic table that contains attribute-value pairs. Problem detection INFORMATION_SCHEMA only 2021-03-07 17:40 MIT License View
374 Do not use approach that one size fits all (primary key columns) Find base base tables have the simple primary key that contains the column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-03-18 20:58 MIT License View
375 Do not use approach that one size fits all (unique index columns) Find base base tables have a simple unique index (not associated with a constraint) that contains the column with the (case insensitive) name id and an integer type. In addition, the key values are generated automatically by the system by using a sequence generator. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-01-07 15:12 MIT License View
376 Do not use dual-purpose foreign keys Find cases where the same column of a base table T is used to record references to multiple base tables. In addition, one has to add additional column to T for holding metadata about the parent table, referenced by the current row. Problem detection INFORMATION_SCHEMA only 2021-03-07 10:56 MIT License View
377 Do not use FLOAT Data Type Find base table columns that have FLOAT, REAL, or DOUBLE PRECISION type. "The data types real and double precision are inexact, variable-precision numeric types. On all currently supported platforms, these types are implementations of IEEE Standard 754 for Binary Floating-Point Arithmetic (single and double precision, respectively), to the extent that the underlying processor, operating system, and compiler support it." (PostgreSQL documentation) Do not use the approximate numeric types FLOAT, REAL, and DOUBLE PRECISION in order to present fractional numeric data. Due to the use of the IEEE 754 standard the results of calculations with the values, which have one of these types, can be inexact because out of necessity some numbers must be rounded to a value, which is very close. "Comparing two floating-point values for equality might not always work as expected." (PostgreSQL documentation) Problem detection INFORMATION_SCHEMA only 2021-03-12 15:41 MIT License View
378 Do not use the money data type Find base table columns with the Money data type. Each value of the money type has associated currency sign that depends on server settings. It could be $. Moreover, using the values for arithmetic operations requires casts that makes the code more complicated. Problem detection INFORMATION_SCHEMA only 2021-02-25 17:29 MIT License View
379 Double checking of the maximum character length Do not duplicate code. In this case a CHECK constraint duplicates the restriction that is already enforced with the help of the declaration of the maximum field size (for instance, VARCHAR(100)). Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-11-18 13:27 MIT License View
380 Double negatives in Boolean expressions Write code that is simple to understand and not confusing. A double negative is a grammatical construction occurring when two forms of negation are used in the same expression (https://en.wikipedia.org/wiki/Double_negative). Double negatives in Boolean expressions make it more difficult to understand and maintain the code. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View