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.
#21. All non-identifying relationships
system catalog base tables onlyFind all non-identifying relationships where the foreign key (a set of columns) is not a subset of any uniqueness constraint (primary key, unique, or exclude constraint).
#22. All non-unique indexes
INFORMATION_SCHEMA+system catalog base tablesFind secondary indexes that have been created in the database.
#23. All parameters with DEFAULT values
INFORMATION_SCHEMA+system catalog base tablesFind parameters of user-defined routines that have a default value.
#24. All partial indexes
INFORMATION_SCHEMA+system catalog base tablesFind indexes to a subset of table rows.
#25. All rules
system catalog base tables onlyFind user-defined rules for rewriting data manipulation language statements. Rules should be used only for the tasks that cannot be achieved in a declarative manner, i.e., for example, by declaring a constraint.
#26. All security policies
system catalog base tables onlyFind all security policies.
#27. All sequence generators
INFORMATION_SCHEMA+system catalog base tablesFind all sequence generators.
#28. All short cycles (tables)
INFORMATION_SCHEMA+system catalog base tablesFind pairs of tables that have both a foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables.
#29. All system-defined TOAST-able types
system catalog base tables onlyFind system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).
#30. All table CHECK constraints that cover at leat one column
INFORMATION_SCHEMA onlyFind all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).
#31. All table functions
INFORMATION_SCHEMA+system catalog base tablesFind all functions that return a set of rows.
#32. All user-defined TOAST-able types
system catalog base tables onlyFind user-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table).
#33. All user mappings
system catalog base tables onlyFind all user mappings for foreign servers and tables
#34. All user schemas
INFORMATION_SCHEMA onlyFind all the schemas in the database that are not used for the system purposes.
#35. All user triggers that are associated with tables
INFORMATION_SCHEMA+system catalog base tablesFind user-defined triggers that react to data modifications in tables. Triggers should be used only for the tasks that cannot be achieved in a declarative manner, i.e., by declaring a constraint. Triggers of the same table with the same event_manipulation, action_timing, and action_orientation are sorted based on the trigger name. This is the order of execution of triggers.
#36. AND takes precedence over OR
INFORMATION_SCHEMA+system catalog base tablesMake sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator.
#37. Are the passwords hashed?
INFORMATION_SCHEMA+system catalog base tablesFind base table columns that name refers to the possibility that these are used to register passwords. Return a value from each such column. Make sure that the password is not registered as open text.
#38. Are there enough routines that implement database operations?
INFORMATION_SCHEMA+system catalog base tablesFind user-defined routines that implement database operations (comment refers to an operation) but show these only if there are at least eight such routines. Contracts of database operations are specified in the system analysis documentation. The contracts apply the idea of design by contract in the field of databases.
#39. A state machine is implemented with the help of a state classifier table
system catalog base tables onlyFind implementations of state machines that use a state classifier table.
#40. At most one row is permitted in a table (based on check constraints)
INFORMATION_SCHEMA+system catalog base tablesFind base tables and foreign tables where based on a check constraint, a key constraint, and a NOT NULL constraint can be at most one row. Make sure that this is the real intent behind the constraint, not a mistake. Find tables where a check constraint permits only one possible value in a column, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint.
| # | 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 |
|---|---|---|---|---|---|---|---|
| 21 | All non-identifying relationships | Find all non-identifying relationships where the foreign key (a set of columns) is not a subset of any uniqueness constraint (primary key, unique, or exclude constraint). | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 22 | All non-unique indexes | Find secondary indexes that have been created in the database. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 23 | All parameters with DEFAULT values | Find parameters of user-defined routines that have a default value. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 24 | All partial indexes | Find indexes to a subset of table rows. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 25 | All rules | Find user-defined rules for rewriting data manipulation language statements. Rules should be used only for the tasks that cannot be achieved in a declarative manner, i.e., for example, by declaring a constraint. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 26 | All security policies | Find all security policies. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 27 | All sequence generators | Find all sequence generators. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 28 | All short cycles (tables) | Find pairs of tables that have both a foreign key that references to the other table. Such cycles can involve more than two tables but the query detects only cycles with two tables. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 29 | All system-defined TOAST-able types | Find system-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table). | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 30 | All table CHECK constraints that cover at leat one column | Find all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications). | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 31 | All table functions | Find all functions that return a set of rows. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 32 | All user-defined TOAST-able types | Find user-defined types in case of which the system can use the TOAST technique, i.e., save the value in a compressed form or store it in a automatically-created secondary table, which is hidden from the database user (TOAST table). | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 33 | All user mappings | Find all user mappings for foreign servers and tables | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 34 | All user schemas | Find all the schemas in the database that are not used for the system purposes. | General | INFORMATION_SCHEMA only | MIT (opens in new tab) | View (opens in new tab) | |
| 35 | All user triggers that are associated with tables | Find user-defined triggers that react to data modifications in tables. Triggers should be used only for the tasks that cannot be achieved in a declarative manner, i.e., by declaring a constraint. Triggers of the same table with the same event_manipulation, action_timing, and action_orientation are sorted based on the trigger name. This is the order of execution of triggers. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 36 | AND takes precedence over OR | Make sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 37 | Are the passwords hashed? | Find base table columns that name refers to the possibility that these are used to register passwords. Return a value from each such column. Make sure that the password is not registered as open text. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 38 | Are there enough routines that implement database operations? | Find user-defined routines that implement database operations (comment refers to an operation) but show these only if there are at least eight such routines. Contracts of database operations are specified in the system analysis documentation. The contracts apply the idea of design by contract in the field of databases. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) | |
| 39 | A state machine is implemented with the help of a state classifier table | Find implementations of state machines that use a state classifier table. | General | system catalog base tables only | MIT (opens in new tab) | View (opens in new tab) | |
| 40 | At most one row is permitted in a table (based on check constraints) | Find base tables and foreign tables where based on a check constraint, a key constraint, and a NOT NULL constraint can be at most one row. Make sure that this is the real intent behind the constraint, not a mistake. Find tables where a check constraint permits only one possible value in a column, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint. | General | INFORMATION_SCHEMA+system catalog base tables | MIT (opens in new tab) | View (opens in new tab) |