A check constraint (also known as table check constraint is a condition that defines valid data when adding or updating an entry in a table of a relational database. A check constraint is applied to each row in the table. The constraint must be a predicate. It can refer to a single or multiple columns of the table. The result of the predicate can be either TRUE, FALSE, or UNKNOWN, depending on the presence of NULLs.
| Property | Value |
| dbpprop:abstract
|
- A check constraint (also known as table check constraint is a condition that defines valid data when adding or updating an entry in a table of a relational database. A check constraint is applied to each row in the table. The constraint must be a predicate. It can refer to a single or multiple columns of the table. The result of the predicate can be either TRUE, FALSE, or UNKNOWN, depending on the presence of NULLs. If the predicate evaluates to UNKNOWN, then the constraint is not violated and the row can be inserted or updated in the table. This is contrary to predicates in WHERE clauses in SELECT or UPDATE statements. For example, in a table containing products, one could add a check constraint such that the price of a product and quantity of a product is a non-negative value: PRICE >= 0 QUANTITY >= 0 If these constraints were not in place, it would be possible to have a negative price (-$30 or quantity (-3 items. Check constraints are used to ensure the validity of data in a database and to provide data integrity. If they are used at the database level, applications that use the database will not be able to add invalid data or modify valid data so the data becomes invalid, even if the application itself accepts invalid data.
- CHECK制約 (-せいやく、Check Constraint)とは、データベースにおいてデータを追加、更新する際の有効なデータを定義する規則のことをいう。チェック制約はテーブルの1つの列に適用され、制約を満足する(True)かもしくは満足しない(False)のいずれかの値を取る式でなければならない。 例えば、「製品」を含むデータベースにおいて、製品の価格と数量はゼロもしくは正の値であるというチェック制約を設けることができる。 PRICE >= 0 QUANTITY >= 0 もしこの制約がない場合は、価格がマイナス30ドルとかマイナス3個の数量といったことが可能になってしまう。 チェック制約はデータの有効性と保全性を確保するために利用され、この制約をデータベースレベルで行うことで、たとえアプリケーションが無効なデータを認めたとしても、データベースにその無効データを追加したり、有効なデータを無効なデータに変更したりすることができなくなる。
|
| dbpprop:hasPhotoCollection
| |
| rdf:type
| |
| rdfs:comment
|
- A check constraint (also known as table check constraint is a condition that defines valid data when adding or updating an entry in a table of a relational database. A check constraint is applied to each row in the table. The constraint must be a predicate. It can refer to a single or multiple columns of the table. The result of the predicate can be either TRUE, FALSE, or UNKNOWN, depending on the presence of NULLs.
|
| rdfs:label
| |
| owl:sameAs
| |
| skos:subject
| |
| foaf:page
| |
| is dbpprop:redirect
of | |
| is owl:sameAs
of | |