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.
#281. Columns with JSON, JSONB, or XML type
INFORMATION_SCHEMA+system catalog base tablesFind columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type.
#282. Comments of derived tables
system catalog base tables onlyFind comments of derived tables (views and materialized views) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, triggers, rules). Make sure that the comments give relevant, useful, and correct information.
#283. Comments of non-derived tables
system catalog base tables onlyFind comments of non-derived tables (base tables, foreign tables, and partitioned tables) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, constraints, indexes, triggers, rules). Make sure that the comments give relevant, useful, and correct information.
#284. Comments of routines
INFORMATION_SCHEMA+system catalog base tablesFind comments of user-defined routines (functions or procedures) that are registered in the system catalog witht a COMMENT statement. Make sure that the comments give relevant, useful, and correct information.
#285. Duplicate comments
INFORMATION_SCHEMA+system catalog base tablesFind comments that have been registered with a COMMENT statement and that are associated with more than one object. It would probably mean that a comment is incorrect or missing.
#286. Completely overlapping foreign keys
INFORMATION_SCHEMA+system catalog base tablesFind completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys.
#287. Duplicate keys
system catalog base tables onlyFind completely overlapping key (primary key, unique, and exclude where all operators are =) constraints. This is a form of duplication. It leads to the creation of multiple indexes to the same set of columns.
#288. Composite foreign keys with an incorrect order of columns (ver 2)
system catalog base tables onlyFind composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key are not the same in terms of data types of the columns. For instance, the query returns information about a foreign key that columns have the types (SMALLINT, INTEGER) that refers to the candidate key that columns have the types (INTEGER, SMALLINT). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause.
#289. Composite foreign keys with an incorrect order of columns (ver 1)
system catalog base tables onlyFind composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key consist of columns with the same name but the order of columns in the keys is different. For instance, the query returns information about a foreign key (personal_code, country_code) that refers to the candidate key (country_code, personal_code). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause.
#290. Composite foreign keys with a mix of mandatory and optional columns
system catalog base tables onlyFind composite foreign keys with a mix of mandatory and optional columns. In case of a composite foreign keys all the columns should either optional or mandatory in order to avoid problems with NULLs.
#291. Too wide composite indexes
system catalog base tables onlyFind composite indexes that do not support any constraint but are on more than three columns.
#292. User-defined composite types
system catalog base tables onlyFind composite types that are created by a user, i.e., the type is not created automatically by the database management system based on a relation.
#293. Duplicate independent (i.e., not created based on a table) composite types
system catalog base tables onlyFind composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication.
#294. Names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name
system catalog base tables onlyFind constraints that are perhaps badly named. Find names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name.
#295. Names of constraints (directly connected to a base table) that do not contain the table name
system catalog base tables onlyFind constraints that are perhaps badly named. Table names help us to ensure the uniqueness of the names within a schema and make the names more expressive and user-friendly.
#296. Table constraints with the cardinality bigger than one
system catalog base tables onlyFind constraints that involve more than one columns. Check as to whether the names follow a common style or not.
#297. Perhaps the name referes to multiple concepts
INFORMATION_SCHEMA+system catalog base tablesFind database objects that name contains words "and" (English) or "ja" (Estonian).
#298. Stating the obvious
INFORMATION_SCHEMA+system catalog base tablesFind database objects that name contains words "data" or "info". These are noise words because databases are meant for storing and manipulating data/information.
#299. Database object that belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ
INFORMATION_SCHEMA+system catalog base tablesFind database object that belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make it more difficult to use the interface by other programs.
#300. Database object that do not belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ
INFORMATION_SCHEMA+system catalog base tablesFind database object that do not belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make the naming style inconsistent with the naming style of elements that belong to the public interface. If applications access base tables directly, then the letters can cause the same problems as in case of derived tables, i.e., applications may have difficulties with such names.
| # | Name | Goal (sorted ascending) | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 281 | Columns with JSON, JSONB, or XML type | Find columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 282 | Comments of derived tables | Find comments of derived tables (views and materialized views) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, triggers, rules). Make sure that the comments give relevant, useful, and correct information. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 283 | Comments of non-derived tables | Find comments of non-derived tables (base tables, foreign tables, and partitioned tables) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, constraints, indexes, triggers, rules). Make sure that the comments give relevant, useful, and correct information. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 284 | Comments of routines | Find comments of user-defined routines (functions or procedures) that are registered in the system catalog witht a COMMENT statement. Make sure that the comments give relevant, useful, and correct information. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 285 | Duplicate comments | Find comments that have been registered with a COMMENT statement and that are associated with more than one object. It would probably mean that a comment is incorrect or missing. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 286 | Completely overlapping foreign keys | Find completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 287 | Duplicate keys | Find completely overlapping key (primary key, unique, and exclude where all operators are =) constraints. This is a form of duplication. It leads to the creation of multiple indexes to the same set of columns. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 288 | Composite foreign keys with an incorrect order of columns (ver 2) | Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key are not the same in terms of data types of the columns. For instance, the query returns information about a foreign key that columns have the types (SMALLINT, INTEGER) that refers to the candidate key that columns have the types (INTEGER, SMALLINT). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 289 | Composite foreign keys with an incorrect order of columns (ver 1) | Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key consist of columns with the same name but the order of columns in the keys is different. For instance, the query returns information about a foreign key (personal_code, country_code) that refers to the candidate key (country_code, personal_code). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 290 | Composite foreign keys with a mix of mandatory and optional columns | Find composite foreign keys with a mix of mandatory and optional columns. In case of a composite foreign keys all the columns should either optional or mandatory in order to avoid problems with NULLs. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 291 | Too wide composite indexes | Find composite indexes that do not support any constraint but are on more than three columns. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 292 | User-defined composite types | Find composite types that are created by a user, i.e., the type is not created automatically by the database management system based on a relation. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 293 | Duplicate independent (i.e., not created based on a table) composite types | Find composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 294 | Names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name | Find constraints that are perhaps badly named. Find names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 295 | Names of constraints (directly connected to a base table) that do not contain the table name | Find constraints that are perhaps badly named. Table names help us to ensure the uniqueness of the names within a schema and make the names more expressive and user-friendly. | Problem detection | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 296 | Table constraints with the cardinality bigger than one | Find constraints that involve more than one columns. Check as to whether the names follow a common style or not. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 297 | Perhaps the name referes to multiple concepts | Find database objects that name contains words "and" (English) or "ja" (Estonian). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 298 | Stating the obvious | Find database objects that name contains words "data" or "info". These are noise words because databases are meant for storing and manipulating data/information. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 299 | Database object that belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ | Find database object that belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make it more difficult to use the interface by other programs. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 300 | Database object that do not belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ | Find database object that do not belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make the naming style inconsistent with the naming style of elements that belong to the public interface. If applications access base tables directly, then the letters can cause the same problems as in case of derived tables, i.e., applications may have difficulties with such names. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |