{"id":15915,"date":"2024-07-19T02:55:26","date_gmt":"2024-07-18T23:25:26","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=15915"},"modified":"2024-07-19T02:55:26","modified_gmt":"2024-07-18T23:25:26","slug":"https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/","title":{"rendered":"SQL\u306e\u9650\u754c\u3092\u7406\u89e3\u3059\u308b"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">\u5c0e\u5165<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u8a08\u3059\u308b\u969b\u306b\u3001\u7279\u5b9a\u306e\u5217\u306b\u5165\u529b\u3067\u304d\u308b\u30c7\u30fc\u30bf\u306b\u5236\u9650\u3092\u8a2d\u3051\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u9ad8\u5c64\u30d3\u30eb\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u683c\u7d0d\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u3001\u5404\u30d3\u30eb\u306e\u9ad8\u3055\u3092\u683c\u7d0d\u3059\u308b\u5217\u306b\u8ca0\u306e\u5024\u3092\u5165\u529b\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002.<\/p>\n<p>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08RDBMS\uff09\u3067\u306f\u3001\u5236\u7d04\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u306b\u8ffd\u52a0\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002\u5236\u7d04\u3068\u306f\u30011\u3064\u307e\u305f\u306f\u8907\u6570\u306e\u5217\uff08\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u5168\u4f53\uff09\u306b\u9069\u7528\u3055\u308c\u308b\u7279\u5225\u306a\u30eb\u30fc\u30eb\u3067\u3042\u308a\u3001\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4ecb\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u306b\u52a0\u3048\u3089\u308c\u308b\u5909\u66f4\u3092\u5236\u9650\u3057\u307e\u3059\u3002 <code>\u5165\u308c\u308b<\/code>\u3001 <code>\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/code>\u3001 \u307e\u305f\u306f <code>\u6d88\u53bb<\/code> \u5236\u9650\u304c\u3042\u308a\u307e\u3059\u3002.<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u5236\u7d04\u3068\u306f\u4f55\u304b\u3001\u305d\u3057\u3066RDBMS\u3067\u3069\u306e\u3088\u3046\u306b\u4f7f\u7528\u3055\u308c\u308b\u304b\u3092\u8a73\u7d30\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u307e\u305f\u3001SQL\u6a19\u6e96\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b5\u3064\u306e\u5236\u7d04\u3092\u305d\u308c\u305e\u308c\u53d6\u308a\u4e0a\u3052\u3001\u5bfe\u5fdc\u3059\u308b\u6a5f\u80fd\u306b\u3064\u3044\u3066\u3082\u8aac\u660e\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d9%85%d8%ad%d8%af%d9%88%d8%af%db%8c%d8%aa-%d9%87%d8%a7-%da%86%db%8c%d8%b3%d8%aa%d8%9f\">\u5236\u9650\u4e8b\u9805\u306f\u4f55\u3067\u3059\u304b?<\/h2>\n<p>SQL\u306b\u304a\u3044\u3066\u3001\u5236\u7d04\u3068\u306f\u3001\u5217\u307e\u305f\u306f\u30c6\u30fc\u30d6\u30eb\u306b\u633f\u5165\u3067\u304d\u308b\u30c7\u30fc\u30bf\u3092\u5236\u9650\u3059\u308b\u30eb\u30fc\u30eb\u3092\u6307\u3057\u307e\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3059\u308b\u64cd\u4f5c\uff08INSERT\u3001UPDATE\u3001DELETE\u6587\u306a\u3069\uff09\u3092\u5b9f\u884c\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001RDBMS\u306f\u30c7\u30fc\u30bf\u304c\u65e2\u5b58\u306e\u5236\u7d04\u306b\u9055\u53cd\u3057\u3066\u3044\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u30c6\u30b9\u30c8\u3057\u3001\u9055\u53cd\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u307e\u3059\u3002.<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u5b9a\u7fa9\u6e08\u307f\u306e\u30d3\u30b8\u30cd\u30b9\u30eb\u30fc\u30eb\u30bb\u30c3\u30c8\u306b\u6e96\u62e0\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u305f\u3081\u306b\u3001\u5236\u7d04\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3088\u304f\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6587\u8108\u306b\u304a\u3044\u3066\u3001\u30d3\u30b8\u30cd\u30b9\u30eb\u30fc\u30eb\u3068\u306f\u3001\u4f01\u696d\u3084\u305d\u306e\u4ed6\u306e\u7d44\u7e54\u304c\u5f93\u3046\u3079\u304d\u30dd\u30ea\u30b7\u30fc\u307e\u305f\u306f\u624b\u9806\u3067\u3042\u308a\u3001\u305d\u306e\u30c7\u30fc\u30bf\u304c\u9075\u5b88\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u9867\u5ba2\u306e\u5e97\u8217\u306e\u5728\u5eab\u3092\u30ab\u30bf\u30ed\u30b0\u5316\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002\u9867\u5ba2\u304c\u5404\u88fd\u54c1\u30ec\u30b3\u30fc\u30c9\u306b\u4e00\u610f\u306e\u8b58\u5225\u756a\u53f7\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u3001UNIQUE\u5236\u7d04\u3092\u6301\u3064\u5217\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u5217\u306b\u540c\u3058\u30a8\u30f3\u30c8\u30ea\u304c2\u3064\u5b58\u5728\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u5236\u7d04\u306f\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3092\u7dad\u6301\u3059\u308b\u306e\u306b\u3082\u5f79\u7acb\u3061\u307e\u3059\u3002\u30c7\u30fc\u30bf\u6574\u5408\u6027\u3068\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u306e\u5168\u4f53\u7684\u306a\u6b63\u78ba\u6027\u3001\u4e00\u8cab\u6027\u3001\u5408\u7406\u6027\u3092\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u57fa\u3065\u3044\u3066\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3088\u304f\u4f7f\u308f\u308c\u308b\u5e83\u7fa9\u306e\u7528\u8a9e\u3067\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u4e92\u3044\u306b\u95a2\u9023\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u304f\u3001\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u306f\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u5024\u306b\u4f9d\u5b58\u3057\u3066\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u5165\u529b\u306f\u4eba\u70ba\u7684\u306a\u30df\u30b9\u304c\u767a\u751f\u3057\u3084\u3059\u3044\u305f\u3081\u3001\u5236\u7d04\u306f\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u6709\u7528\u3067\u3059\u3002\u5236\u7d04\u306b\u3088\u3063\u3066\u3001\u8aa4\u3063\u3066\u5165\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u305d\u306e\u3088\u3046\u306a\u95a2\u4fc2\u6027\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3092\u640d\u306a\u3046\u3053\u3068\u304c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>2\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u6301\u3064\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u8a08\u3057\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u30021\u3064\u306f\u5b66\u6821\u306e\u5728\u6821\u751f\u3092\u30ea\u30b9\u30c8\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3001\u3082\u30461\u3064\u306f\u305d\u306e\u5b66\u6821\u306e\u30d0\u30b9\u30b1\u30c3\u30c8\u30dc\u30fc\u30eb\u30c1\u30fc\u30e0\u306e\u30e1\u30f3\u30d0\u30fc\u3092\u30ea\u30b9\u30c8\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002\u30d0\u30b9\u30b1\u30c3\u30c8\u30dc\u30fc\u30eb\u30c1\u30fc\u30e0\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u306b\u3001\u5b66\u6821\u30c6\u30fc\u30d6\u30eb\u306e\u5217\u3092\u53c2\u7167\u3059\u308b\u5916\u90e8\u30ad\u30fc\u5236\u7d04\u3092\u9069\u7528\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c1\u30fc\u30e0\u30c6\u30fc\u30d6\u30eb\u306e\u5404\u30a8\u30f3\u30c8\u30ea\u304c\u751f\u5f92\u30c6\u30fc\u30d6\u30eb\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u53c2\u7167\u3059\u308b\u3088\u3046\u306b\u8981\u6c42\u3059\u308b\u3053\u3068\u3067\u30012\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u9593\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u304c\u78ba\u7acb\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u306f\u30c6\u30fc\u30d6\u30eb\u3092\u6700\u521d\u306b\u4f5c\u6210\u3059\u308b\u3068\u304d\u306b\u5236\u7d04\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u65e2\u5b58\u306e\u30c7\u30fc\u30bf\u3068\u7af6\u5408\u3057\u306a\u3044\u9650\u308a\u3001ALTER TABLE \u6587\u3092\u4f7f\u7528\u3057\u3066\u5f8c\u304b\u3089\u5236\u7d04\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u5236\u7d04\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u540d\u524d\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u304c\u3001\u307b\u3068\u3093\u3069\u306eSQL\u5b9f\u88c5\u3067\u306f\u3001\u5404\u5236\u7d04\u306b\u30ab\u30b9\u30bf\u30e0\u540d\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u540d\u524d\u306f\u3001ALTER TABLE \u6587\u3067\u5236\u7d04\u304c\u5909\u66f4\u307e\u305f\u306f\u524a\u9664\u3055\u308c\u305f\u3068\u304d\u306b\u3001\u305d\u306e\u5236\u7d04\u3092\u53c2\u7167\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>SQL \u6a19\u6e96\u3067\u306f\u3001\u6b63\u5f0f\u306b\u306f\u6b21\u306e 5 \u3064\u306e\u5236\u7d04\u306e\u307f\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u4e3b\u30ad\u30fc<\/li>\n<li>\u5916\u90e8\u30ad\u30fc<\/li>\n<li>\u500b\u6027\u7684<\/li>\n<li>\u30ec\u30d3\u30e5\u30fc<\/li>\n<li>\u7a7a\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<\/ul>\n<p>\u5236\u7d04\u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5927\u307e\u304b\u306b\u7406\u89e3\u3067\u304d\u305f\u306e\u3067\u3001\u6b21\u306b\u3053\u308c\u3089 5 \u3064\u306e\u5236\u7d04\u3092\u305d\u308c\u305e\u308c\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002.<\/p>\n<h2 id=\"%da%a9%d9%84%db%8c%d8%af-%d8%a7%d9%88%d9%84%db%8c%d9%87\">\u4e3b\u30ad\u30fc<\/h2>\n<p>PRIMARY KEY \u5236\u7d04\u3067\u306f\u3001\u7279\u5b9a\u306e\u5217\u306e\u5404\u30a8\u30f3\u30c8\u30ea\u304c\u4e00\u610f\u3067\u3042\u308a\u3001NULL \u3067\u306f\u306a\u3044\u3053\u3068\u304c\u8981\u6c42\u3055\u308c\u308b\u305f\u3081\u3001\u305d\u306e\u5217\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u500b\u3005\u306e\u884c\u3092\u8b58\u5225\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30e2\u30c7\u30eb\u306b\u304a\u3044\u3066\u3001\u30ad\u30fc\u3068\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5217\u307e\u305f\u306f\u5217\u30bb\u30c3\u30c8\u306e\u3053\u3068\u3067\u3042\u308a\u3001\u5404\u5024\u306f\u4e00\u610f\u3067\u3042\u308a\u3001NULL\u5024\u3092\u542b\u307e\u306a\u3044\u3053\u3068\u304c\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4e3b\u30ad\u30fc\u306f\u7279\u5225\u306a\u30ad\u30fc\u3067\u3042\u308a\u3001\u305d\u306e\u5024\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u500b\u3005\u306e\u884c\u3092\u8b58\u5225\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u4e3b\u30ad\u30fc\u3092\u69cb\u6210\u3059\u308b\u5217\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6b8b\u308a\u306e\u90e8\u5206\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u8b58\u5225\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>\u3053\u308c\u306f\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u91cd\u8981\u306a\u5074\u9762\u306e\u4e00\u3064\u3067\u3059\u3002\u4e3b\u30ad\u30fc\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u30c7\u30fc\u30bf\u304c\u7269\u7406\u7684\u306b\u30de\u30b7\u30f3\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001DBMS\u306f\u5404\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u8de1\u3057\u3001\u30a2\u30c9\u30db\u30c3\u30af\u306b\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30ec\u30b3\u30fc\u30c9\u306b\u8ad6\u7406\u7684\u306a\u9806\u5e8f\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u3089\u305a\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u4efb\u610f\u306e\u9806\u5e8f\u3084\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002.<\/p>\n<p>SQL\u3067\u306f\u3001PRIMARY KEY\u5236\u7d04\u3092\u4f7f\u7528\u3057\u3066\u4e3b\u30ad\u30fc\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u57fa\u672c\u7684\u306bUNIQUE\u5236\u7d04\u3068NOT NULL\u5236\u7d04\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u3082\u306e\u3067\u3059\u3002\u4e3b\u30ad\u30fc\u304c\u5b9a\u7fa9\u3055\u308c\u308b\u3068\u3001DBMS\u306f\u305d\u308c\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u3088\u308a\u901f\u304f\u53d6\u5f97\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u69cb\u9020\u3067\u3059\u3002\u6559\u79d1\u66f8\u306e\u7d22\u5f15\u306e\u3088\u3046\u306b\u3001\u30af\u30a8\u30ea\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4ed8\u3051\u3089\u308c\u305f\u5217\u306e\u30a8\u30f3\u30c8\u30ea\u3092\u8abf\u3079\u308b\u3060\u3051\u3067\u95a2\u9023\u3059\u308b\u5024\u3092\u898b\u3064\u3051\u3089\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4e3b\u30ad\u30fc\u306f\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5404\u884c\u306e\u8b58\u5225\u5b50\u3068\u3057\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002.<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u4e3b\u30ad\u30fc\u30921\u3064\u3057\u304b\u6301\u3066\u307e\u305b\u3093\u304c\u3001\u901a\u5e38\u306e\u30ad\u30fc\u3068\u540c\u69d8\u306b\u3001\u4e3b\u30ad\u30fc\u306f\u8907\u6570\u306e\u5217\u3067\u69cb\u6210\u3067\u304d\u307e\u3059\u3002\u3068\u306f\u3044\u3048\u3001\u4e3b\u30ad\u30fc\u306e\u7279\u5fb4\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5404\u884c\u3092\u4e00\u610f\u306b\u8b58\u5225\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u6700\u5c0f\u9650\u306e\u5c5e\u6027\u30bb\u30c3\u30c8\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u306e\u6982\u5ff5\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e3\u3064\u306e\u5217\u3092\u4f7f\u7528\u3057\u3066\u5b66\u6821\u306e\u751f\u5f92\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u683c\u7d0d\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u60f3\u50cf\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><code>\u5b66\u751fID<\/code>: \u5404\u751f\u5f92\u306e\u56fa\u6709\u306e\u8b58\u5225\u756a\u53f7\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059<\/li>\n<li><code>\u30d5\u30a1\u30fc\u30b9\u30c8\u30cd\u30fc\u30e0<\/code>: \u5404\u751f\u5f92\u306e\u540d\u524d\u3092\u8a18\u5165\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059<\/li>\n<li><code>\u82d7\u5b57<\/code>: \u5404\u751f\u5f92\u306e\u59d3\u3092\u8a18\u5165\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059<\/li>\n<\/ul>\n<p>\u5b66\u6821\u5185\u306e\u751f\u5f92\u306e\u4e2d\u306b\u306f\u3001\u540c\u3058\u540d\u524d\uff08\u30d5\u30a1\u30fc\u30b9\u30c8\u30cd\u30fc\u30e0\uff09\u3092\u6301\u3064\u751f\u5f92\u304c\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u3001firstName\u5217\u3092\u4e3b\u30ad\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u306e\u306f\u9069\u5207\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002lastName\u5217\u306b\u3064\u3044\u3066\u3082\u540c\u69d8\u3067\u3059\u3002firstName\u5217\u3068lastName\u5217\u306e\u4e21\u65b9\u3092\u4e3b\u30ad\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u30822\u4eba\u306e\u751f\u5f92\u304c\u540c\u3058\u540d\u524d\uff08\u30d5\u30a1\u30fc\u30b9\u30c8\u30cd\u30fc\u30e0\u3068\u30e9\u30b9\u30c8\u30cd\u30fc\u30e0\uff09\u3092\u6301\u3064\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002.<\/p>\n<p>\u5b66\u751fID\u3068firstName\u5217\u307e\u305f\u306flastName\u5217\u304b\u3089\u306a\u308b\u4e3b\u30ad\u30fc\u3082\u6709\u52b9\u3067\u3059\u304c\u3001\u5404\u5b66\u751f\u306eID\u756a\u53f7\u306f\u65e2\u306b\u4e00\u610f\u3067\u3042\u308b\u305f\u3081\u3001\u5404\u540d\u524d\u5217\u3092\u4e3b\u30ad\u30fc\u306b\u542b\u3081\u308b\u306e\u306f\u5197\u9577\u3067\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u3053\u306e\u5834\u5408\u3001\u5404\u884c\u3092\u8b58\u5225\u3067\u304d\u308b\u6700\u5c0f\u9650\u306e\u5c5e\u6027\u30bb\u30c3\u30c8\u306f\u3001\u5b66\u751fID\u5217\u306e\u307f\u3067\u3042\u308a\u3001\u3053\u308c\u304c\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u3068\u3057\u3066\u9069\u5207\u3067\u3059\u3002.<\/p>\n<p>\u30ad\u30fc\u304c\u89b3\u6e2c\u53ef\u80fd\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30c7\u30fc\u30bf\uff08\u3064\u307e\u308a\u3001\u73fe\u5b9f\u4e16\u754c\u306e\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3001\u30a4\u30d9\u30f3\u30c8\u3001\u307e\u305f\u306f\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u3059\u30c7\u30fc\u30bf\uff09\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u308c\u306f\u81ea\u7136\u30ad\u30fc\u3068\u547c\u3070\u308c\u307e\u3059\u3002\u30ad\u30fc\u304c\u5185\u90e8\u7684\u306b\u751f\u6210\u3055\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5916\u90e8\u306e\u3082\u306e\u3092\u4f55\u3082\u8868\u3055\u306a\u3044\u5834\u5408\u3001\u305d\u308c\u306f\u4ee3\u7406\u30ad\u30fc\u307e\u305f\u306f\u4eba\u5de5\u30ad\u30fc\u3068\u547c\u3070\u308c\u307e\u3059\u3002\u4e00\u90e8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001\u4e00\u898b\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u30c7\u30fc\u30bf\u30dd\u30a4\u30f3\u30c8\u3067\u3055\u3048\u4e88\u6e2c\u3067\u304d\u306a\u3044\u5f62\u3067\u5909\u5316\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u81ea\u7136\u30ad\u30fc\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u305b\u3093\u3002.<\/p>\n<h2 id=\"%da%a9%d9%84%db%8c%d8%af-%d8%ae%d8%a7%d8%b1%d8%ac%db%8c\">\u5916\u90e8\u30ad\u30fc<\/h2>\n<p>FOREIGN KEY \u5236\u7d04\u3067\u306f\u3001\u7279\u5b9a\u306e\u5217\u306e\u5404\u30a8\u30f3\u30c8\u30ea\u304c\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u7279\u5b9a\u306e\u5217\u306b\u65e2\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002.<\/p>\n<p>2\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u76f8\u4e92\u306b\u95a2\u9023\u4ed8\u3051\u305f\u3044\u5834\u5408\u3001FOREIGN KEY\u5236\u7d04\u3092\u4f7f\u7528\u3057\u3066\u5916\u90e8\u30ad\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u5916\u90e8\u30ad\u30fc\u3068\u306f\u3001\u4e00\u65b9\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u300c\u5b50\u300d\u30c6\u30fc\u30d6\u30eb\uff09\u306e\u5217\u306e\u5024\u304c\u3001\u3082\u3046\u4e00\u65b9\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u300c\u89aa\u300d\u30c6\u30fc\u30d6\u30eb\uff09\u306e\u30ad\u30fc\u304b\u3089\u53d6\u5f97\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30012\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u9593\u306e\u95a2\u4fc2\u3092\u8868\u3059\u65b9\u6cd5\u3067\u3059\u3002FOREIGN KEY\u5236\u7d04\u3067\u306f\u3001\u9069\u7528\u5bfe\u8c61\u306e\u5217\u306e\u5024\u304c\u3001\u53c2\u7167\u5148\u306e\u5217\u306b\u3082\u5fc5\u305a\u5b58\u5728\u3059\u308b\u3053\u3068\u304c\u6761\u4ef6\u3068\u306a\u308a\u307e\u3059\u3002.<\/p>\n<p>\u6b21\u306e\u56f3\u306f\u30012\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u9593\u306e\u95a2\u4fc2\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u30021\u3064\u306f\u4f1a\u793e\u306e\u5f93\u696d\u54e1\u306b\u95a2\u3059\u308b\u60c5\u5831\u3092\u8a18\u9332\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3001\u3082\u30461\u3064\u306f\u4f1a\u793e\u306e\u58f2\u4e0a\u3092\u8ffd\u8de1\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001EMPLOYEES\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u304cSALES\u30c6\u30fc\u30d6\u30eb\u306e\u5916\u90e8\u30ad\u30fc\u306b\u3088\u3063\u3066\u53c2\u7167\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img  loading=\"lazy\"  decoding=\"async\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  width=\"1160\"  height=\"840\"  class=\"aligncenter wp-image-15918 size-full pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"auto, (max-width: 1160px) 100vw, 1160px\"  data-pk-src=\"https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8.png\"  data-pk-srcset=\"https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8.png 1160w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-300x217.png 300w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-1024x742.png 1024w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-768x556.png 768w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-110x80.png 110w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-200x145.png 200w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-380x275.png 380w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-255x185.png 255w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-550x398.png 550w, https:\/\/cdn.itpiran.net\/2024\/07\/19024637\/1-8-800x579.png 800w\" ><\/p>\n<p>\u5b50\u30c6\u30fc\u30d6\u30eb\u306b\u30ec\u30b3\u30fc\u30c9\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u969b\u306b\u3001\u5916\u90e8\u30ad\u30fc\u5217\u306b\u5165\u529b\u3055\u308c\u305f\u5024\u304c\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u306b\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u3001\u633f\u5165\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306f\u7121\u52b9\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4e21\u65b9\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u306f\u5e38\u306b\u6b63\u3057\u304f\u95a2\u9023\u4ed8\u3051\u3089\u308c\u308b\u305f\u3081\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u30ec\u30d9\u30eb\u3067\u306e\u6574\u5408\u6027\u304c\u7dad\u6301\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>\u591a\u304f\u306e\u5834\u5408\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u5916\u90e8\u30ad\u30fc\u306f\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u3068\u540c\u3058\u3067\u3059\u304c\u3001\u5fc5\u305a\u3057\u3082\u305d\u3046\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u307b\u3068\u3093\u3069\u306eRDBMS\u3067\u306f\u3001\u89aa\u30c6\u30fc\u30d6\u30eb\u3067UNIQUE\u5236\u7d04\u307e\u305f\u306fPRIMARY KEY\u5236\u7d04\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5217\u306f\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u5916\u90e8\u30ad\u30fc\u304b\u3089\u53c2\u7167\u3067\u304d\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d9%85%d9%86%d8%ad%d8%b5%d8%b1-%d8%a8%d9%81%d8%b1%d8%af\">\u500b\u6027\u7684<\/h2>\n<p>UNIQUE \u5236\u7d04\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u5217\u306b\u91cd\u8907\u3059\u308b\u5024\u304c\u8ffd\u52a0\u3055\u308c\u308b\u306e\u3092\u9632\u304e\u307e\u3059\u3002.<\/p>\n<p>\u540d\u524d\u304c\u793a\u3059\u3088\u3046\u306b\u3001UNIQUE\u5236\u7d04\u306f\u3001\u7279\u5b9a\u306e\u5217\u306e\u5404\u30a8\u30f3\u30c8\u30ea\u304c\u4e00\u610f\u306e\u5024\u3092\u6301\u3064\u3053\u3068\u3092\u8981\u6c42\u3057\u307e\u3059\u3002\u5217\u306b\u65e2\u306b\u5b58\u5728\u3059\u308b\u5024\u3092\u8ffd\u52a0\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002.<\/p>\n<p>UNIQUE\u5236\u7d04\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u9593\u306e1\u5bfe1\u306e\u95a2\u4fc2\u3092\u78ba\u7acb\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u524d\u8ff0\u306e\u3088\u3046\u306b\u3001\u5916\u90e8\u30ad\u30fc\u3092\u4f7f\u7528\u3057\u30662\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u9593\u306e\u95a2\u4fc2\u3092\u78ba\u7acb\u3067\u304d\u307e\u3059\u304c\u3001\u30c6\u30fc\u30d6\u30eb\u9593\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u7a2e\u985e\u306e\u95a2\u4fc2\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><code><code>\u06cc\u06a9 \u0628\u0647 \u06cc\u06a9<\/code><\/code>\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u304c\u5b50\u30c6\u30fc\u30d6\u30eb\u306e 1 \u3064\u306e\u884c\u306b\u306e\u307f\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u5834\u5408\u30012 \u3064\u306e\u30c6\u30fc\u30d6\u30eb\u306f 1 \u5bfe 1 \u306e\u95a2\u4fc2\u306b\u3042\u308b\u3068\u8a00\u308f\u308c\u307e\u3059\u3002.<\/li>\n<li><code>1\u5bfe\u591a<\/code>: \u591a\u5bfe\u4efb\u610f\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3067\u306f\u3001\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u306f\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u6570\u306e\u884c\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u307e\u3059\u304c\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u5404\u884c\u306f\u89aa\u30c6\u30fc\u30d6\u30eb\u306e 1 \u3064\u306e\u884c\u306b\u306e\u307f\u95a2\u9023\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002.<\/li>\n<li><code>\u5e7e\u3064\u304b\uff1f<\/code>\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u884c\u304c\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u8907\u6570\u306e\u884c\u306b\u95a2\u9023\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u305d\u306e\u9006\u3082\u6210\u308a\u7acb\u3064\u5834\u5408\u30012 \u3064\u306e\u9593\u306b\u306f\u591a\u5bfe\u591a\u306e\u95a2\u4fc2\u304c\u3042\u308b\u3068\u8a00\u308f\u308c\u307e\u3059\u3002.<\/li>\n<\/ul>\n<p>FOREIGN KEY \u5236\u7d04\u304c\u9069\u7528\u3055\u308c\u3066\u3044\u308b\u5217\u306b UNIQUE \u5236\u7d04\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u5404\u30a8\u30f3\u30c8\u30ea\u304c\u5b50\u30c6\u30fc\u30d6\u30eb\u306b 1 \u56de\u3060\u3051\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u30012 \u3064\u306e\u30c6\u30fc\u30d6\u30eb\u9593\u306b 1 \u5bfe 1 \u306e\u95a2\u4fc2\u304c\u78ba\u7acb\u3055\u308c\u307e\u3059\u3002.<\/p>\n<p>UNIQUE\u5236\u7d04\u306f\u3001\u5217\u30ec\u30d9\u30eb\u3060\u3051\u3067\u306a\u304f\u30c6\u30fc\u30d6\u30eb\u30ec\u30d9\u30eb\u3067\u3082\u5b9a\u7fa9\u3067\u304d\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30c6\u30fc\u30d6\u30eb\u30ec\u30d9\u30eb\u3067\u5b9a\u7fa9\u3057\u305f\u5834\u5408\u3001UNIQUE\u5236\u7d04\u306f\u8907\u6570\u306e\u5217\u306b\u9069\u7528\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u5236\u7d04\u5185\u306e\u5404\u5217\u306b\u306f\u91cd\u8907\u3057\u305f\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u5404\u884c\u306b\u306f\u5236\u7d04\u5bfe\u8c61\u5217\u306e\u5024\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u4e00\u610f\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d8%a8%d8%b1%d8%b1%d8%b3%db%8c\">\u30ec\u30d3\u30e5\u30fc<\/h2>\n<p>CHECK \u5236\u7d04\u306f\u3001\u5217\u306b\u5165\u529b\u3055\u308c\u308b\u5024\u304c\u6e80\u305f\u3059\u5fc5\u8981\u304c\u3042\u308b\u6761\u4ef6 (\u8ff0\u8a9e\u3068\u547c\u3070\u308c\u308b) \u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002.<\/p>\n<p>CHECK\u5236\u7d04\u8ff0\u8a9e\u306f\u3001TRUE\u3001FALSE\u3001\u307e\u305f\u306f\u6f5c\u5728\u7684\u306b\u4e0d\u660e\u306a\u5024\u306b\u8a55\u4fa1\u3055\u308c\u308b\u5f0f\u3068\u3057\u3066\u8a18\u8ff0\u3055\u308c\u307e\u3059\u3002CHECK\u5236\u7d04\u306b\u5024\u3092\u5165\u529b\u3057\u3001\u305d\u306e\u5024\u306b\u3088\u3063\u3066\u6587\u304cTRUE\u307e\u305f\u306f\u4e0d\u660e\u306a\u5024\uff08NULL\u5024\u306e\u5834\u5408\u306b\u767a\u751f\uff09\u306b\u8a55\u4fa1\u3055\u308c\u305f\u5834\u5408\u3001\u64cd\u4f5c\u306f\u6210\u529f\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5f0f\u304cFALSE\u306b\u8a55\u4fa1\u3055\u308c\u305f\u5834\u5408\u306f\u5931\u6557\u3057\u307e\u3059\u3002.<\/p>\n<p>CHECK\u8ff0\u8a9e\u306f\u3001\u591a\u304f\u306e\u5834\u5408\u3001\u6570\u5b66\u7684\u306a\u6bd4\u8f03\u6f14\u7b97\u5b50\uff08&lt;\u3001&gt;\u3001&lt;=\u3001OR &gt;=\u306a\u3069\uff09\u3092\u4f7f\u7528\u3057\u3066\u3001\u7279\u5b9a\u306e\u5217\u3067\u8a31\u5bb9\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306e\u7bc4\u56f2\u3092\u5236\u9650\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001CHECK\u5236\u7d04\u306e\u4e00\u822c\u7684\u306a\u7528\u9014\u306e\u4e00\u3064\u306f\u3001\u4ee5\u4e0b\u306e\u4f8b\u306e\u3088\u3046\u306b\u3001\u8ca0\u306e\u5024\u304c\u610f\u5473\u3092\u306a\u3055\u306a\u3044\u5834\u5408\u306b\u3001\u4e00\u90e8\u306e\u5217\u306b\u8ca0\u306e\u5024\u304c\u4fdd\u6301\u3055\u308c\u308b\u306e\u3092\u9632\u3050\u3053\u3068\u3067\u3059\u3002.<\/p>\n<p>\u3053\u306e CREATE TABLE \u6587\u306f\u3001\u5404\u88fd\u54c1\u306e\u540d\u79f0\u3001ID\u756a\u53f7\u3001\u4fa1\u683c\u306e\u5217\u3092\u6301\u3064 productInfo \u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u88fd\u54c1\u306e\u4fa1\u683c\u304c\u8ca0\u306e\u5024\u3092\u6301\u3064\u3053\u3068\u306f\u610f\u5473\u3092\u306a\u3055\u306a\u3044\u305f\u3081\u3001\u3053\u306e\u6587\u306f\u4fa1\u683c\u5217\u306b CHECK \u5236\u7d04\u3092\u9069\u7528\u3057\u3001\u6b63\u306e\u5024\u306e\u307f\u3092\u6301\u3064\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-sql\" data-lang=\"SQL\"><code>CREATE TABLE productInfo (\r\nproductID int,\r\nname varchar(30),\r\nprice decimal(4,2)\r\nCHECK (price &gt; 0)\r\n);<\/code><\/pre>\n<\/div>\n<p>\u3059\u3079\u3066\u306eCHECK\u8ff0\u8a9e\u3067\u6570\u5b66\u7684\u306a\u6bd4\u8f03\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u901a\u5e38\u3001CHECK\u8ff0\u8a9e\u3067\u306f\u3001LIKE\u3001BETWEEN\u3001IS NOT NULL\u306a\u3069\u3001\u771f\u3001\u507d\u3001\u307e\u305f\u306f\u4e0d\u660e\u3068\u8a55\u4fa1\u3067\u304d\u308b\u4efb\u610f\u306eSQL\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u4e00\u90e8\u306eSQL\u5b9f\u88c5\u3067\u306f\u3001CHECK\u8ff0\u8a9e\u306b\u30b5\u30d6\u30af\u30a8\u30ea\u3092\u542b\u3081\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u3059\u3079\u3066\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u3001\u307b\u3068\u3093\u3069\u306e\u5b9f\u88c5\u3067\u306f\u3001\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u5185\u3067\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002.<\/p>\n<h2 id=\"%d8%aa%d9%87%db%8c-%d9%86%db%8c%d8%b3%d8%aa\">\u7a7a\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/h2>\n<p>NOT NULL \u5236\u7d04\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u5217\u306b NULL \u5024\u304c\u8ffd\u52a0\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002.<\/p>\n<p>\u307b\u3068\u3093\u3069\u306eSQL\u5b9f\u88c5\u3067\u306f\u3001\u30c7\u30fc\u30bf\u884c\u3092\u633f\u5165\u3057\u305f\u969b\u306b\u7279\u5b9a\u306e\u5217\u306b\u5024\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b7\u30b9\u30c6\u30e0\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u305d\u306e\u6b20\u640d\u30c7\u30fc\u30bf\u3092NULL\u3068\u3057\u3066\u6271\u3044\u307e\u3059\u3002SQL\u306b\u304a\u3044\u3066\u3001NULL\u306f\u672a\u77e5\u306e\u5024\u3001\u6b20\u640d\u5024\u3001\u307e\u305f\u306f\u672a\u6307\u5b9a\u5024\u3092\u8868\u3059\u7279\u5225\u306a\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u3059\u3002\u305f\u3060\u3057\u3001NULL\u306f\u5024\u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f\u3001\u672a\u77e5\u306e\u5024\u306e\u72b6\u614b\u3092\u8868\u3057\u307e\u3059\u3002.<\/p>\n<p>\u3053\u306e\u9055\u3044\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306b\u3001\u30bf\u30ec\u30f3\u30c8\u4e8b\u52d9\u6240\u3067\u9867\u5ba2\u7ba1\u7406\u3092\u884c\u3046\u30c6\u30fc\u30d6\u30eb\u3092\u60f3\u50cf\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u3001\u5404\u9867\u5ba2\u306e\u59d3\u3068\u540d\u3092\u5165\u529b\u3059\u308b\u5217\u304c\u3042\u308a\u307e\u3059\u3002\u9867\u5ba2\u304c\u300c\u30b7\u30a7\u30fc\u30eb\u300d\u3001\u300c\u30a2\u30c3\u30b7\u30e3\u30fc\u300d\u3001\u300c\u30d3\u30e8\u30f3\u30bb\u300d\u306a\u3069\u3001\u540d\u524d\u30921\u3064\u3060\u3051\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u8005\u306f\u300c\u540d\u300d\u5217\u306b\u540d\u524d\u30921\u3064\u3057\u304b\u5165\u529b\u3057\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u7d50\u679c\u3001DBMS\u306f\u300c\u59d3\u300d\u5217\u306bNULL\u3092\u633f\u5165\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u3001\u9867\u5ba2\u306e\u59d3\u3092\u6587\u5b57\u901a\u308a\u300cNULL\u300d\u3068\u306f\u898b\u306a\u3057\u307e\u305b\u3093\u3002\u3053\u308c\u306f\u3001\u305d\u306e\u884c\u306e\u59d3\u5217\u306e\u5024\u304c\u4e0d\u660e\u3067\u3042\u308b\u304b\u3001\u305d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u305d\u306e\u30ec\u30b3\u30fc\u30c9\u306b\u9069\u7528\u3055\u308c\u306a\u3044\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3060\u3051\u3067\u3059\u3002.<\/p>\n<p>\u540d\u524d\u304c\u793a\u3059\u3088\u3046\u306b\u3001NOT NULL\u5236\u7d04\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u5217\u306e\u5024\u304cNULL\u306b\u306a\u308b\u3053\u3068\u3092\u7981\u6b62\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001NOT NULL\u5236\u7d04\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u5217\u306b\u306f\u3001\u65b0\u3057\u3044\u884c\u3092\u633f\u5165\u3059\u308b\u969b\u306b\u5fc5\u305a\u5024\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3046\u3057\u306a\u3044\u3068\u3001INSERT\u64cd\u4f5c\u306f\u5931\u6557\u3057\u307e\u3059\u3002.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">\u7d50\u679c<\/h2>\n<p>\u5236\u7d04\u306f\u3001\u9ad8\u3044\u30ec\u30d9\u30eb\u306e\u30c7\u30fc\u30bf\u6574\u5408\u6027\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u5099\u3048\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u8a08\u3057\u3088\u3046\u3068\u3059\u308b\u3059\u3079\u3066\u306e\u4eba\u306b\u3068\u3063\u3066\u4e0d\u53ef\u6b20\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u5217\u306b\u5165\u529b\u3055\u308c\u308b\u30c7\u30fc\u30bf\u3092\u5236\u9650\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u9593\u306e\u95a2\u4fc2\u304c\u9069\u5207\u306b\u7dad\u6301\u3055\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u305d\u306e\u76ee\u7684\u3092\u5b9a\u7fa9\u3059\u308b\u30d3\u30b8\u30cd\u30b9\u30eb\u30fc\u30eb\u306b\u6e96\u62e0\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3067\u304d\u307e\u3059\u3002.<\/p>","protected":false},"excerpt":{"rendered":"\u306f\u3058\u3081\u306b \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8a2d\u8a08\u3059\u308b\u969b\u306b\u3001\u30c7\u30fc\u30bf\u306b\u5236\u9650\u3092\u8ab2\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002","protected":false},"author":1,"featured_media":15916,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,349],"tags":[403,391],"class_list":{"0":"post-15915","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-database","9":"tag-data-base","10":"tag-mysql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 \u0647\u0646\u06af\u0627\u0645 \u0637\u0631\u0627\u062d\u06cc \u06cc\u06a9 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0645\u0648\u0627\u0642\u0639\u06cc \u067e\u06cc\u0634 \u0628\u06cc\u0627\u06cc\u062f \u06a9\u0647 \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc\u06cc \u0628\u0631\u0627\u06cc \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-18T23:25:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL\",\"datePublished\":\"2024-07-18T23:25:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/\"},\"wordCount\":107,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19024037\\\/sql.jpg\",\"keywords\":[\"data base\",\"MySQL\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/\",\"name\":\"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19024037\\\/sql.jpg\",\"datePublished\":\"2024-07-18T23:25:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19024037\\\/sql.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/07\\\/19024037\\\/sql.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/ja\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL\u306e\u9650\u754c\u3092\u7406\u89e3\u3059\u308b - ITPiran\u30d6\u30ed\u30b0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/","og_locale":"ja_JP","og_type":"article","og_title":"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 \u0647\u0646\u06af\u0627\u0645 \u0637\u0631\u0627\u062d\u06cc \u06cc\u06a9 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\u060c \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0645\u0648\u0627\u0642\u0639\u06cc \u067e\u06cc\u0634 \u0628\u06cc\u0627\u06cc\u062f \u06a9\u0647 \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc\u06cc \u0628\u0631\u0627\u06cc \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/ja\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-07-18T23:25:26+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"admin","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL","datePublished":"2024-07-18T23:25:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/"},"wordCount":107,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg","keywords":["data base","MySQL"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/","name":"SQL\u306e\u9650\u754c\u3092\u7406\u89e3\u3059\u308b - ITPiran\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg","datePublished":"2024-07-18T23:25:26+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/07\/19024037\/sql.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/https-www-digitalocean-com-community-conceptual-articles-understanding-sql-constraints\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u062f\u0631\u06a9 \u0645\u062d\u062f\u0648\u062f\u06cc\u062a \u0647\u0627\u06cc SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran\u30d6\u30ed\u30b0","description":"\u30a4\u30e9\u30f3\u306e\u6301\u7d9a\u53ef\u80fd\u306a\u8cbf\u6613\u306b\u95a2\u3059\u308b\u30cb\u30e5\u30fc\u30b9\u3068\u8a18\u4e8b","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"\u6301\u7d9a\u53ef\u80fd\u306a\u30a4\u30e9\u30f3\u30d3\u30b8\u30cd\u30b9\u30d6\u30ed\u30b0","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"\u7ba1\u7406\u8005","url":"https:\/\/www.itpiran.net\/blog\/ja\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/15915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/comments?post=15915"}],"version-history":[{"count":2,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/15915\/revisions"}],"predecessor-version":[{"id":15919,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/posts\/15915\/revisions\/15919"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/media\/15916"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/media?parent=15915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/categories?post=15915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/ja\/wp-json\/wp\/v2\/tags?post=15915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}