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.

#261. AND takes precedence over OR

INFORMATION_SCHEMA+system catalog base tables

Make sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator.

General License: MIT (opens in new tab)

#262. A non-parameterized table function instead of a view

INFORMATION_SCHEMA+system catalog base tables

Find table functions that do not have any parameters. Prefer simpler and more portable solutions.

Problem detection License: MIT (opens in new tab)

#263. A predefine character class has been incorrectly specified

INFORMATION_SCHEMA+system catalog base tables

Find regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:].

Problem detection License: MIT (opens in new tab)

#264. Are the passwords hashed?

INFORMATION_SCHEMA+system catalog base tables

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

#265. Are there enough routines that implement database operations?

INFORMATION_SCHEMA+system catalog base tables

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

#266. A routine is invoked only once

INFORMATION_SCHEMA+system catalog base tables

Find user-defined routines that are invoked by exactly one user-defined routine.

Problem detection License: MIT (opens in new tab)

#267. A setter does not update a table

INFORMATION_SCHEMA+system catalog base tables

Find user-defined non-trigger SQL and PL/pgSQL routines that name starts with "set" (but not with "setting") but do not contain a UPDATE statement.

Problem detection License: MIT (opens in new tab)

#268. A state machine is implemented with the help of an enumeration type

INFORMATION_SCHEMA+system catalog base tables

Find implementations of state machines that uses an enumeration type.

Problem detection License: MIT (opens in new tab)

#269. A state machine is implemented with the help of a state classifier table

system catalog base tables only

Find implementations of state machines that use a state classifier table.

General License: MIT (opens in new tab)

#270. A table has the same name as a routine

INFORMATION_SCHEMA+system catalog base tables

Find table names that are the same as some routine name. Use different names to avoid confusion.

Problem detection License: MIT (opens in new tab)

#271. At most one row is permitted in a table (based on check constraints)

INFORMATION_SCHEMA+system catalog base tables

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

#272. At most one row is permitted in a table (based on enumeration types)

INFORMATION_SCHEMA+system catalog base tables

Find base tables and foreign tables where based on the type of a column, 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 column has an enumeration type with exactly one value, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint.

General License: MIT (opens in new tab)

#273. Base table column name is the same as its domain name

INFORMATION_SCHEMA only

Find base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these.

Problem detection License: MIT (opens in new tab)

#274. Base table column of comments/descriptions has an incorrect data type or maximum character length

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values.

Problem detection License: MIT (opens in new tab)

#275. Base table column of national identification numbers does not have a correct data type

INFORMATION_SCHEMA only

Find non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers.

Problem detection License: MIT (opens in new tab)

#276. Base table column of personal names has questionable properties

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account.

Problem detection License: MIT (opens in new tab)

#277. Base table column of quantities does not have a numeric type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type.

Problem detection License: MIT (opens in new tab)

#278. Base table column of sums of money does not have a numeric type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type.

Problem detection License: MIT (opens in new tab)

#279. Base table column of sums of money has too big or small scale

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column.

Problem detection License: MIT (opens in new tab)

#280. Base table column of surrogate key values does not have an integer data type (based on column names)

INFORMATION_SCHEMA+system catalog base tables

Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(activate to sort ascending) Data source(activate to sort ascending) Last update(sorted descending, activate to sort ascending) License Actions
261 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)
262 A non-parameterized table function instead of a view Find table functions that do not have any parameters. Prefer simpler and more portable solutions. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
263 A predefine character class has been incorrectly specified Find regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:]. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
264 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)
265 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)
266 A routine is invoked only once Find user-defined routines that are invoked by exactly one user-defined routine. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
267 A setter does not update a table Find user-defined non-trigger SQL and PL/pgSQL routines that name starts with "set" (but not with "setting") but do not contain a UPDATE statement. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
268 A state machine is implemented with the help of an enumeration type Find implementations of state machines that uses an enumeration type. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
269 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)
270 A table has the same name as a routine Find table names that are the same as some routine name. Use different names to avoid confusion. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
271 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)
272 At most one row is permitted in a table (based on enumeration types) Find base tables and foreign tables where based on the type of a column, 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 column has an enumeration type with exactly one value, 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)
273 Base table column name is the same as its domain name Find base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
274 Base table column of comments/descriptions has an incorrect data type or maximum character length Find base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
275 Base table column of national identification numbers does not have a correct data type Find non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
276 Base table column of personal names has questionable properties Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
277 Base table column of quantities does not have a numeric type (based on column names) Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
278 Base table column of sums of money does not have a numeric type (based on column names) Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
279 Base table column of sums of money has too big or small scale Find base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
280 Base table column of surrogate key values does not have an integer data type (based on column names) Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)