回答編集履歴

1

他のやり方

2017/06/01 01:50

投稿

m.ts10806
m.ts10806

スコア80850

test CHANGED
@@ -5,3 +5,15 @@
5
5
 
6
6
 
7
7
  [CHECK制約をエミュレートする新旧の方法とドメイン (MySQL Server Blogより)](https://yakst.com/ja/posts/3764)
8
+
9
+
10
+
11
+ # 他のやり方?
12
+
13
+
14
+
15
+ 男、女とだけレコードが入った性別マスタテーブルを作って、「性別」カラムに外部キー制約をつけるとそれ以外のデータが入ってこないようにできそうです。
16
+
17
+
18
+
19
+ [外部キー制約](https://www.dbonline.jp/mysql/table/index11.html)