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.
#21. Definition of a non-minimal superkey instead of a candidate key (based on sequence generators)
INFORMATION_SCHEMA+system catalog base tablesCandidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary keys and unique constraints where a proper subset of the key is a column with an associated sequence generator. Most certainly such subset contains unique values. Thus, this subset should be the key, not its superset.
#22. Perhaps too many square brackets
INFORMATION_SCHEMA+system catalog base tablesCharacter classes are surrounded by two pairs of square brackets.
#23. Check as to wheteher the names of parameters are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#24. Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming.
#25. Check as to wheteher the names of columns are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming.
#26. Check as to wheteher the names of columns are in the plural or in the singular form (English version) (aggregate view)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of columns that name is in plural or in singular by table type.
#27. Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#28. Check as to wheteher the names of tables are in the plural or in the singular form (English version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#29. Check as to wheteher the names of tables are in the plural or in the singular form (Estonian version)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming.
#30. Check as to wheteher the names of tables are in the plural or in the singular form (English version) (aggregate view)
INFORMATION_SCHEMA+system catalog base tablesCheck as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of tables that name is in plural or in singular by table type.
#31. Table privileges
INFORMATION_SCHEMA onlyCheck as to whether there are no unnecessary privileges.
#32. CHECK constraints with the cardinality bigger than one that involve the same set of columns
system catalog base tables onlyCHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.
#33. CHAR columns have a default value that length is shorter from the character maximum length of the column
INFORMATION_SCHEMA onlyChoose a suitable data type, field size, and default value. If the default value is shorter from the character maximum length, then spaces will be added to the end of the registered value.
#34. Multiple deletes from the same table in a routine
INFORMATION_SCHEMA+system catalog base tablesCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of deleting different rows of the same table with different DELETE statements one should try to do it with one statement. The query excludes routines where IF statement is used.
#35. Multiple selects from the same table in a routine
INFORMATION_SCHEMA+system catalog base tablesCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of selecting different fields of the same row with different SELECT INTO statements one should try to do it with one statement.
#36. Multiple updates of the same table in a routine
INFORMATION_SCHEMA+system catalog base tablesCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of updating different fields of the same table with different UPDATE statements one should try to do it with one statement.
#37. Grantees
INFORMATION_SCHEMA onlyDatabase must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database.
#38. Mixing the use of TEXT and VARCHAR type in case of base table columns
INFORMATION_SCHEMA onlyDeclaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)
#39. Delimited identifiers
INFORMATION_SCHEMA+system catalog base tablesDelimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management.
#40. Depth of referential tree of a schema
system catalog base tables onlyDepth of referential tree of a database schema is the longest referential path between the tables in this schema (Piattini et al., 2001). In other words, it is the biggest value among the DRT(T) values of all the tables of the schema.
| # | Name | Goal (sorted ascending) | Type | Data source | Last update | License | Actions |
|---|---|---|---|---|---|---|---|
| 21 | Definition of a non-minimal superkey instead of a candidate key (based on sequence generators) | Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary keys and unique constraints where a proper subset of the key is a column with an associated sequence generator. Most certainly such subset contains unique values. Thus, this subset should be the key, not its superset. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 22 | Perhaps too many square brackets | Character classes are surrounded by two pairs of square brackets. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 23 | Check as to wheteher the names of parameters are in the plural or in the singular form (English version) | Check as to wheteher the names of routine parameters 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) | |
| 24 | Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of routine parameters 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) | |
| 25 | Check as to wheteher the names of columns are in the plural or in the singular form (English version) | Check as to wheteher the names of table columns 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) | |
| 26 | Check as to wheteher the names of columns are in the plural or in the singular form (English version) (aggregate view) | Check as to wheteher the names of table columns are in the plural or in the singular form. Make sure that you are consistent in naming. Show the number of columns that name is in plural or in singular by table type. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 27 | Check as to wheteher the names of columns 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) | |
| 28 | Check as to wheteher the names of tables are in the plural or in the singular form (English 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) | |
| 29 | 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) | |
| 30 | Check as to wheteher the names of tables are in the plural or in the singular form (English version) (aggregate view) | 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. Show the number of tables that name is in plural or in singular by table type. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 31 | Table privileges | Check as to whether there are no unnecessary privileges. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 32 | 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) | |
| 33 | CHAR columns have a default value that length is shorter from the character maximum length of the column | Choose a suitable data type, field size, and default value. If the default value is shorter from the character maximum length, then spaces will be added to the end of the registered value. | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 34 | Multiple deletes from the same table in a routine | Code should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of deleting different rows of the same table with different DELETE statements one should try to do it with one statement. The query excludes routines where IF statement is used. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 35 | Multiple selects from the same table in a routine | Code should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of selecting different fields of the same row with different SELECT INTO statements one should try to do it with one statement. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 36 | Multiple updates of the same table in a routine | Code should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of updating different fields of the same table with different UPDATE statements one should try to do it with one statement. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 37 | Grantees | Database must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 38 | Mixing the use of TEXT and VARCHAR type in case of base table columns | Declaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 39 | Delimited identifiers | Delimited identifiers (quoted identifiers) are case sensitive. Identifiers of database objects should be case insensitive in order to simplify their management. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 40 | Depth of referential tree of a schema | Depth of referential tree of a database schema is the longest referential path between the tables in this schema (Piattini et al., 2001). In other words, it is the biggest value among the DRT(T) values of all the tables of the schema. | Sofware measure | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) |