Filter Queries

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

#361. Domains that are associated with a sequence generator

INFORMATION_SCHEMA only

Domains are reusable artifacts. By associating a domain with a sequence generator, one essentially starts to share sequence generators between tables. It may cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently, i.e., it increases coupling between tables.

Problem detection License: MIT (opens in new tab)

#362. Domains with the same name in different schemas

INFORMATION_SCHEMA only

Domains are like words that can be used to construct generalized claims about the real world (table predicates). Better not to duplicate the words in the dictionary.

Problem detection License: MIT (opens in new tab)

#363. Do not always depend on one's parent - column names are ot sufficiently different

system catalog base tables only

Find where a hierarchical structure is implemented in a base table by adding a foreign key that refers to a candidate key of the same table. Find only cases where the candidate key and foreign key column names are very similar (Levenshtein distance shorter than four).

Problem detection License: MIT (opens in new tab)

#364. Do not assume you must use files

INFORMATION_SCHEMA only

Find cases where you store images and other media as files outside the database and store in the database only paths to the files.

Problem detection License: MIT (opens in new tab)

#365. Do not assume you must use files (based on user data)

INFORMATION_SCHEMA+system catalog base tables

Find cases where you store images and other media as files outside the database and store in the database only paths to the files.

Problem detection License: MIT (opens in new tab)

#366. Do not clone columns

INFORMATION_SCHEMA only

"Split a base table column into multiple columns based on the values in some other column. Each such newly created column has the name, a part of which is a data value from the original tables."(Bill Karwin) Find base tables that have more than one columns with the same type and field size and the difference between the columns are the year or month number at the end of the column name (two or four numbers, preceded by an underscore).

Problem detection License: MIT (opens in new tab)

#367. Do not clone tables

INFORMATION_SCHEMA only

Find cases where a base table has been split horizontally into multiple smaller base tables based on the distinct values in one of the columns of the original table. Each such newly created table has the name, a part of which is a data value from the original tables. Find base tables that have the same columns (column name, column order, data type) and the difference between the tables are the numbers in the table names (table1, table2, etc.).

Problem detection License: MIT (opens in new tab)

#368. Do not create multiple columns for the same attribute

INFORMATION_SCHEMA only

Find base tables that implement recording multivalued attribute values with the help of repeating group of columns. Find base tables that have more than one columns with the same type and field size and the difference between the columns are the numbers in the column names (column1, column2, etc.).

Problem detection License: MIT (opens in new tab)

#369. Do not create user-defined routines that have the same name as some installed extension routine

INFORMATION_SCHEMA+system catalog base tables

Avoid creating user-defined routines that have the same name as some extension routine because it may cause confusion.

Problem detection License: MIT (opens in new tab)

#370. Do not format comma-separated lists (based on column names)

INFORMATION_SCHEMA only

Find, based on column names, 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 License: MIT (opens in new tab)

#371. Do not format comma-separated lists (based on default values)

INFORMATION_SCHEMA only

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

#372. Do not format comma-separated lists (based on user data)

INFORMATION_SCHEMA+system catalog base tables

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

#373. Do not leave out referential constraints (based on composite keys)

INFORMATION_SCHEMA+system catalog base tables

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

#374. Do not leave out the referential constraints (based on adjacency list design)

INFORMATION_SCHEMA+system catalog base tables

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

#375. Do not leave out the referential constraints (based on classifiers)

INFORMATION_SCHEMA+system catalog base tables

This query identifies short text columns in base tables that are not part of any primary or foreign key, but whose names closely match an existing table in the database. This pattern suggests that the similarly named table might be a classifier (reference) table, and the flagged column should ideally have a foreign key constraint referencing it.

Problem detection License: MIT (opens in new tab)

#376. Do not leave out the referential constraints (based on column names)

INFORMATION_SCHEMA+system catalog base tables

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

#377. Do not leave out the referential constraints (based on column names) (2)

INFORMATION_SCHEMA+system catalog base tables

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

#378. Do not leave out the referential constraints (islands)

system catalog base tables only

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

#379. Do not leave out the referential constraints (pairs of tables)

INFORMATION_SCHEMA+system catalog base 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 License: MIT (opens in new tab)

#380. Do not refer to the table schema in the references to columns

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(sorted ascending, activate to sort descending) Data source(activate to sort ascending) Last update(activate to sort ascending) License Actions
361 Domains that are associated with a sequence generator Domains are reusable artifacts. By associating a domain with a sequence generator, one essentially starts to share sequence generators between tables. It may cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently, i.e., it increases coupling between tables. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
362 Domains with the same name in different schemas Domains are like words that can be used to construct generalized claims about the real world (table predicates). Better not to duplicate the words in the dictionary. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
363 Do not always depend on one's parent - column names are ot sufficiently different Find where a hierarchical structure is implemented in a base table by adding a foreign key that refers to a candidate key of the same table. Find only cases where the candidate key and foreign key column names are very similar (Levenshtein distance shorter than four). Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
364 Do not assume you must use files Find cases where you store images and other media as files outside the database and store in the database only paths to the files. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
365 Do not assume you must use files (based on user data) Find cases where you store images and other media as files outside the database and store in the database only paths to the files. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
366 Do not clone columns "Split a base table column into multiple columns based on the values in some other column. Each such newly created column has the name, a part of which is a data value from the original tables."(Bill Karwin) Find base tables that have more than one columns with the same type and field size and the difference between the columns are the year or month number at the end of the column name (two or four numbers, preceded by an underscore). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
367 Do not clone tables Find cases where a base table has been split horizontally into multiple smaller base tables based on the distinct values in one of the columns of the original table. Each such newly created table has the name, a part of which is a data value from the original tables. Find base tables that have the same columns (column name, column order, data type) and the difference between the tables are the numbers in the table names (table1, table2, etc.). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
368 Do not create multiple columns for the same attribute Find base tables that implement recording multivalued attribute values with the help of repeating group of columns. Find base tables that have more than one columns with the same type and field size and the difference between the columns are the numbers in the column names (column1, column2, etc.). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
369 Do not create user-defined routines that have the same name as some installed extension routine Avoid creating user-defined routines that have the same name as some extension routine because it may cause confusion. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
370 Do not format comma-separated lists (based on column names) Find, based on column names, 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 MIT (opens in new tab) View (opens in new tab)
371 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 MIT (opens in new tab) View (opens in new tab)
372 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 MIT (opens in new tab) View (opens in new tab)
373 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 MIT (opens in new tab) View (opens in new tab)
374 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 MIT (opens in new tab) View (opens in new tab)
375 Do not leave out the referential constraints (based on classifiers) This query identifies short text columns in base tables that are not part of any primary or foreign key, but whose names closely match an existing table in the database. This pattern suggests that the similarly named table might be a classifier (reference) table, and the flagged column should ideally have a foreign key constraint referencing it. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
376 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 MIT (opens in new tab) View (opens in new tab)
377 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 MIT (opens in new tab) View (opens in new tab)
378 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 MIT (opens in new tab) View (opens in new tab)
379 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 MIT (opens in new tab) View (opens in new tab)
380 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 MIT (opens in new tab) View (opens in new tab)