0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

制約、IN述語

Last updated at Posted at 2023-01-08

DDLとは?

CHECK制約

CHECK制約は、テーブルにデータを(挿入も含む)更新する際に条件を満たすか検証し、もし満たさない場合はエラーにしてしまう機能になります。

出典 (check 制約で検索)

 ある列の取りうる値の範囲を制限するための制約

出典

CHECK制約【check constraint】チェック制約 / 検査制約

出典

検査制約とは?

検査制約(CHECK)

売上表で個数は整数で10個以下でなければならないというような定義です。

   CREATE TABLE 売上表
   (
    商品 ・・・.
    個数 INTEGER CHECK(個数<=10),
    ・・・,
   );

出典

IN述語

OR演算子の省略形。
選択対象としたい値が増えるにつれてSQLも長大になり、読みにくくなることです。こんな時にIN(値,...)という形式で書き換えることができる。

OR演算子

条件においてのまたはを表す。

出典

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?