{"id":1898,"date":"2025-05-17T14:19:40","date_gmt":"2025-05-17T05:19:40","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=1898"},"modified":"2026-02-17T14:19:55","modified_gmt":"2026-02-17T05:19:55","slug":"mysql%e5%a4%96%e9%83%a8%e3%82%ad%e3%83%bc%e3%82%a8%e3%83%a9%e3%83%bc%e8%a7%a3%e6%b1%ba%ef%bd%9cdrop-table%e5%bc%b7%e5%88%b6%e5%89%8a%e9%99%a4%e3%81%ae1%e8%a1%8c","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1898\/","title":{"rendered":"MySQL\u5916\u90e8\u30ad\u30fc\u30a8\u30e9\u30fc\u89e3\u6c7a\uff5cDROP TABLE\u5f37\u5236\u524a\u9664\u306e1\u884c"},"content":{"rendered":"<div>\n<h2>\u306f\u3058\u3081\u306b\uff5c\u3053\u306e\u8a18\u4e8b\u3067\u5f97\u3089\u308c\u308b\u4fa1\u5024<\/h2>\n<p>\n    \u958b\u767a\u74b0\u5883\u3067<strong>DROP TABLE<\/strong>\u3092\u5b9f\u884c\u3002<br \/>\n    \u2015\u2015\u3059\u308b\u3068 <strong>foreign key constraint violation<\/strong>\u3002<\/p>\n<p>    \u300c\u3069\u306e\u9806\u756a\u3067\u6d88\u305b\u3070\u3044\u3044\u306e\uff1f\u300d\u3068\u624b\u304c\u6b62\u307e\u3063\u305f\u7d4c\u9a13\u3001\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<br \/>\n    \u672c\u8a18\u4e8b\u3067\u306f\u3001<strong>\u6700\u901f\u3067\u74b0\u5883\u3092\u7acb\u3066\u76f4\u30591\u884c\u306e\u30b3\u30fc\u30c9\u3068\u3001\u305d\u306e\u7406\u7531<\/strong>\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<br \/>\n    \u307e\u305a\u306f\u7d50\u8ad6\u304b\u3089\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002\n  <\/p>\n<hr \/>\n<h2>1. \u6700\u901f\u3067\u6b62\u8840\u3059\u308b\u300c\u9b54\u6cd5\u306e1\u884c\u300d<\/h2>\n<h3>\u25a0 MySQL \/ MariaDB\u306e\u5834\u5408<\/h3>\n<p><strong>\u5916\u90e8\u30ad\u30fc\u5236\u7d04<\/strong>\u306e\u30c1\u30a7\u30c3\u30af\u3092\u4e00\u6642\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<p>\n    \uff08SQL\u69cb\u6587\u3084\u30a8\u30e9\u30fc\u5bfe\u7b56\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1786\/\" target=\"_blank\" rel=\"noopener\">SQL\u65e5\u4ed8\u95a2\u6570\u306e\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u73fe\u5834\u3067\u4f7f\u3048\u308b\u30c6\u30f3\u30d7\u30ec\u30fb\u5931\u6557\u56de\u907f\u6cd5\u3082\u89e3\u8aac<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u5916\u90e8\u30ad\u30fc\u5236\u7d04\uff08Foreign Key Constraint\uff09<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u300c\u89aa\u5b50\u300d\u30c6\u30fc\u30d6\u30eb\u306e\u95a2\u4fc2\u3092\u5b88\u308b\u4ed5\u7d44\u307f\u3002\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u5024\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u3001\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u767b\u9332\u3084\u524a\u9664\u304c\u3067\u304d\u306a\u3044\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDROP TABLE<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u5b8c\u5168\u306b\u524a\u9664\u3059\u308bSQL\u30b3\u30de\u30f3\u30c9\u3002\u95a2\u9023\u30c7\u30fc\u30bf\u3084\u69cb\u9020\u3082\u6d88\u3048\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aTRUNCATE<\/strong><br \/>\n      \u30c6\u30fc\u30d6\u30eb\u306e\u5168\u30c7\u30fc\u30bf\u3092\u4e00\u62ec\u524a\u9664\u3059\u308bSQL\u30b3\u30de\u30f3\u30c9\u3002\u69cb\u9020\u306f\u6b8b\u308b\u304c\u30c7\u30fc\u30bf\u306f\u6d88\u3048\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aSET FOREIGN_KEY_CHECKS<\/strong><br \/>\n      MySQL\/MariaDB\u3067\u5916\u90e8\u30ad\u30fc\u5236\u7d04\u306e\u30c1\u30a7\u30c3\u30af\u3092\u4e00\u6642\u7684\u306b\u7121\u52b9\u5316\u30fb\u518d\u6709\u52b9\u5316\u3059\u308b\u8a2d\u5b9a\u3002\n    <\/p>\n<\/blockquote>\n<pre><code>SET FOREIGN_KEY_CHECKS = 0;\r\n-- \u3053\u3053\u306bDROP\u3084TRUNCATE\u3092\u66f8\u304f\r\n-- DROP TABLE users;\r\n-- DROP DATABASE sample_db;\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n<\/code><\/pre>\n<p>\n    \u5236\u7d04\u30c1\u30a7\u30c3\u30af\u3092\u4e00\u6642\u7684\u306b\u30aa\u30d5\u306b\u3057\u3001\u5f37\u5236\u7684\u306b\u524a\u9664\u3067\u304d\u308b\u72b6\u614b\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n    <strong>\u5fc5\u305a\u6700\u5f8c\u306bON\u3078\u623b\u3059<\/strong>\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\n  <\/p>\n<h3>\u25a0 PostgreSQL\u306e\u5834\u5408<\/h3>\n<p>\n    PostgreSQL\u306b\u306f<strong>FOREIGN_KEY_CHECKS<\/strong>\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n    \u4ee3\u308f\u308a\u306b\u4f7f\u3046\u306e\u304c<strong>CASCADE<\/strong>\u3067\u3059\u3002\n  <\/p>\n<p>\n    \uff08PostgreSQL\u3084DB\u69cb\u9020\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1811\/\" target=\"_blank\" rel=\"noopener\">Oracle MySQL \u9055\u3044\u30927\u3064\u306e\u8996\u70b9\u3067\u5fb9\u5e95\u6bd4\u8f03\uff5c\u79fb\u884c\u30fb\u9078\u5b9a\u3067\u8ff7\u308f\u306a\u3044\u6700\u65b0\u30ac\u30a4\u30c9<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aCASCADE<\/strong><br \/>\n      \u30c6\u30fc\u30d6\u30eb\u524a\u9664\u6642\u306b\u3001\u95a2\u9023\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u3084\u4f9d\u5b58\u30c7\u30fc\u30bf\u3082\u307e\u3068\u3081\u3066\u524a\u9664\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3002PostgreSQL\u3084\u4ed6DB\u3067\u5229\u7528\u3002\n    <\/p>\n<\/blockquote>\n<pre><code>DROP TABLE IF EXISTS users CASCADE;\r\n<\/code><\/pre>\n<p>\n    \u4f9d\u5b58\u3057\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u3082\u307e\u3068\u3081\u3066\u524a\u9664\u3057\u307e\u3059\u3002<br \/>\n    \u300c\u95a2\u9023\u3054\u3068\u6d88\u3059\u300d\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>2. \u306a\u305c\u3053\u306e1\u884c\u3067\u89e3\u6c7a\u3059\u308b\u306e\u304b\uff1f<\/h2>\n<p>\n    \u306a\u305c\u524a\u9664\u3067\u304d\u306a\u3044\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n    \u7b54\u3048\u306f<strong>\u53c2\u7167\u6574\u5408\u6027<\/strong>\u3067\u3059\u3002\n  <\/p>\n<p>\n    \uff08\u53c2\u7167\u6574\u5408\u6027\u3084JOIN\u306e\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1119\/\" target=\"_blank\" rel=\"noopener\">SQL JOIN\u306e\u57fa\u672c\u304b\u3089\u5b9f\u8df5\u307e\u3067\uff5cINNER\u30fbLEFT\u30fbRIGHT\u30fbOUTER JOIN\u306e\u9055\u3044\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u53c2\u7167\u6574\u5408\u6027\uff08Referential Integrity\uff09<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u300c\u89aa\u5b50\u300d\u95a2\u4fc2\u306e\u77db\u76fe\u3092\u9632\u3050\u30eb\u30fc\u30eb\u3002\u89aa\u304c\u6d88\u3048\u308b\u3068\u5b50\u3082\u6d88\u3059\u3001\u307e\u305f\u306f\u5b50\u304c\u6b8b\u3089\u306a\u3044\u3088\u3046\u5236\u7d04\u3092\u8a2d\u3051\u308b\u3002\n    <\/p>\n<\/blockquote>\n<h3>\u25a0 \u89aa\u5b50\u95a2\u4fc2\u306e\u30a4\u30e1\u30fc\u30b8<\/h3>\n<ul>\n<li><strong>users<\/strong>\uff08\u89aa\uff09<\/li>\n<li><strong>posts<\/strong>\uff08\u5b50\uff09<\/li>\n<\/ul>\n<p>\n    <strong>posts.user_id<\/strong>\u306f<strong>users.id<\/strong>\u3092\u53c2\u7167\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n    \u5b50\u304c\u5b58\u5728\u3059\u308b\u306e\u306b\u89aa\u3092\u524a\u9664\u3059\u308b\u3068\u77db\u76fe\u304c\u8d77\u304d\u307e\u3059\u3002<br \/>\n    \u3053\u308c\u304c<strong>foreign key constraint violation<\/strong>\u306e\u6b63\u4f53\u3067\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u30c1\u30a7\u30c3\u30af\u3092\u5916\u3059\u3068\u3069\u3046\u306a\u308b\uff1f<\/h3>\n<p>\n    <strong>SET FOREIGN_KEY_CHECKS = 0;<\/strong>\u306f\u3001<br \/>\n    \u300c\u4eca\u3060\u3051\u89aa\u5b50\u95a2\u4fc2\u3092\u898b\u306a\u3044\u300d\u3068\u3044\u3046\u5ba3\u8a00\u3067\u3059\u3002<br \/>\n    \u958b\u767a\u74b0\u5883\u3067\u306f\u3053\u306e\u5f37\u5236\u7a81\u7834\u304c\u5f79\u7acb\u3061\u307e\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>3. \u3088\u304f\u3042\u308b\u767a\u751f\u30d1\u30bf\u30fc\u30f3<\/h2>\n<h3>\u25a0 \u2460 \u5b50\u304c\u6b8b\u3063\u305f\u307e\u307e\u89aa\u3092\u524a\u9664<\/h3>\n<p>\n    <strong>posts<\/strong>\u304c\u5b58\u5728 \u2192 <strong>users<\/strong>\u3092DROP\u3002<br \/>\n    \u5f53\u7136\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u2461 \u5b58\u5728\u3057\u306a\u3044\u89aa\u3092\u53c2\u7167<\/h3>\n<p>\n    <strong>user_id = 999<\/strong> \u2192 \u305d\u306e\u30e6\u30fc\u30b6\u30fc\u306f\u5b58\u5728\u3057\u306a\u3044\u3002<br \/>\n    \u3053\u308c\u3082\u9055\u53cd\u3067\u3059\u3002<br \/>\n    <strong>\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027<\/strong>\u3092\u5b88\u308b\u4ed5\u7d44\u307f\u304c\u3042\u306a\u305f\u3092\u6b62\u3081\u3066\u3044\u308b\u306e\u3067\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>4. \u958b\u767a\u74b0\u5883\u3068\u672c\u756a\u74b0\u5883\u306e\u9055\u3044<\/h2>\n<h3>\u25a0 \u958b\u767a\u74b0\u5883\u3067\u306fOK\u306a\u7406\u7531<\/h3>\n<ul>\n<li>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u4e2d\u5fc3<\/li>\n<li>\u4f55\u5ea6\u3082\u4f5c\u308a\u76f4\u3059<\/li>\n<li>\u30b9\u30ad\u30fc\u30de\u5909\u66f4\u304c\u983b\u7e41<\/li>\n<\/ul>\n<p>\u30b9\u30d4\u30fc\u30c9\u512a\u5148\u306a\u3089\u4e00\u6642\u7684\u7121\u52b9\u5316\u306f\u6709\u52b9\u3067\u3059\u3002<\/p>\n<p>\n    \uff08\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3084\u73fe\u5834\u904b\u7528\u306e\u30b3\u30c4\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1802\/\" target=\"_blank\" rel=\"noopener\">\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30ec\u30d3\u30e5\u30fc\u30fb\u30c6\u30b9\u30c8\u30ec\u30d3\u30e5\u30fc\u5fb9\u5e95\u89e3\u8aac\uff01SES\u73fe\u58343\u30b9\u30c6\u30c3\u30d7\u30ac\u30a4\u30c9<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b9\u30ad\u30fc\u30de<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3084\u30eb\u30fc\u30eb\u3092\u5b9a\u7fa9\u3057\u305f\u8a2d\u8a08\u56f3\u3002\u30c6\u30fc\u30d6\u30eb\u3084\u30ab\u30e9\u30e0\u3001\u5236\u7d04\u306a\u3069\u306e\u60c5\u5831\u3092\u307e\u3068\u3081\u3066\u7ba1\u7406\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf<\/strong><br \/>\n      \u958b\u767a\u3084\u691c\u8a3c\u306e\u305f\u3081\u306b\u7528\u610f\u3055\u308c\u305f\u4eee\u306e\u30c7\u30fc\u30bf\u3002\u672c\u756a\u904b\u7528\u3068\u306f\u7570\u306a\u308a\u3001\u81ea\u7531\u306b\u8ffd\u52a0\u30fb\u524a\u9664\u3067\u304d\u308b\u3002\n    <\/p>\n<\/blockquote>\n<h3>\u25a0 \u672c\u756a\u3067\u3084\u308b\u3068\u3069\u3046\u306a\u308b\uff1f<\/h3>\n<p>\n    <strong>\u7d76\u5bfe\u306b\u63a8\u5968\u3057\u307e\u305b\u3093\u3002<\/strong><br \/>\n    \u6574\u5408\u6027\u304c\u58ca\u308c\u307e\u3059\u3002\n  <\/p>\n<ul>\n<li>\u5b99\u306b\u6d6e\u3044\u305f\u30c7\u30fc\u30bf\u767a\u751f<\/li>\n<li>\u96c6\u8a08\u306e\u4e0d\u6574\u5408<\/li>\n<li>\u4e88\u671f\u305b\u306c\u30d0\u30b0<\/li>\n<\/ul>\n<p>\u672c\u756a\u3067\u306f<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u3084<strong>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3<\/strong>\u3067\u5b89\u5168\u306b\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u9020\u3084\u30c7\u30fc\u30bf\u3092\u5b89\u5168\u306b\u5909\u66f4\u30fb\u79fb\u884c\u3059\u308b\u624b\u9806\u3084\u30c4\u30fc\u30eb\u3002\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3084\u81ea\u52d5\u5316\u304c\u53ef\u80fd\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3<\/strong><br \/>\n      \u4e00\u9023\u306e\u51e6\u7406\u3092\u307e\u3068\u3081\u3066\u300c\u6210\u529f\u300d\u307e\u305f\u306f\u300c\u5931\u6557\u300d\u3068\u3057\u3066\u6271\u3046\u4ed5\u7d44\u307f\u3002\u9014\u4e2d\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408\u306f\u5168\u3066\u5143\u306b\u623b\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>5. \u4e00\u6b69\u5148\u306e\u904b\u7528\u8a2d\u8a08<\/h2>\n<h3>\u25a0 ON DELETE CASCADE<\/h3>\n<p>\n    <strong>ON DELETE CASCADE<\/strong>\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u3001<br \/>\n    \u89aa\u524a\u9664 \u2192 \u5b50\u3082\u81ea\u52d5\u524a\u9664\u3002<br \/>\n    \u8a2d\u8a08\u6bb5\u968e\u3067\u9023\u9396\u524a\u9664\u3092\u7d44\u307f\u8fbc\u3081\u307e\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aON DELETE CASCADE<\/strong><br \/>\n      \u5916\u90e8\u30ad\u30fc\u5236\u7d04\u306e\u4e00\u7a2e\u3002\u89aa\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u3068\u3001\u95a2\u9023\u3059\u308b\u5b50\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3082\u81ea\u52d5\u3067\u524a\u9664\u3055\u308c\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u8ad6\u7406\u524a\u9664<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u81ea\u4f53\u306f\u6b8b\u3057\u3001\u524a\u9664\u30d5\u30e9\u30b0\u3084\u65e5\u6642\uff08deleted_at\uff09\u3067\u300c\u524a\u9664\u6e08\u307f\u300d\u3068\u6271\u3046\u65b9\u6cd5\u3002\u5fa9\u5143\u3084\u5c65\u6b74\u7ba1\u7406\u304c\u53ef\u80fd\u3002\n    <\/p>\n<\/blockquote>\n<h3>\u25a0 \u8ad6\u7406\u524a\u9664\u3068\u3044\u3046\u9078\u629e\u80a2<\/h3>\n<p>\u7269\u7406\u524a\u9664\u305b\u305a<strong>deleted_at<\/strong>\u3092\u6301\u305f\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u5fa9\u5143\u3067\u304d\u308b<\/li>\n<li>\u5c65\u6b74\u304c\u6b8b\u308b<\/li>\n<\/ul>\n<hr \/>\n<h2>6. \u3088\u304f\u3042\u308b\u8cea\u554f\uff08Q&amp;A\uff09<\/h2>\n<h3>\u25a0 Q. TRUNCATE\u3082\u5f15\u3063\u304b\u304b\u308b\uff1f<\/h3>\n<p>\u306f\u3044\u3002<strong>\u5916\u90e8\u30ad\u30fc\u5236\u7d04<\/strong>\u304c\u3042\u308b\u3068\u5931\u6557\u3057\u307e\u3059\u3002<\/p>\n<pre><code>SET FOREIGN_KEY_CHECKS = 0;<\/code><\/pre>\n<pre><code>TRUNCATE TABLE users CASCADE;<\/code><\/pre>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aTRUNCATE TABLE<\/strong><br \/>\n      \u30c6\u30fc\u30d6\u30eb\u306e\u5168\u30c7\u30fc\u30bf\u3092\u4e00\u62ec\u524a\u9664\u3059\u308bSQL\u30b3\u30de\u30f3\u30c9\u3002\u5916\u90e8\u30ad\u30fc\u5236\u7d04\u304c\u3042\u308b\u5834\u5408\u306f\u5931\u6557\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\n    <\/p>\n<\/blockquote>\n<h3>\u25a0 Q. \u6709\u52b9\u5316\u3092\u5fd8\u308c\u305f\u3089\uff1f<\/h3>\n<p>\n    \u305d\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u3001\u5236\u7d04\u30c1\u30a7\u30c3\u30af\u306f\u7121\u52b9\u306e\u307e\u307e\u3067\u3059\u3002<br \/>\n    \u5fc5\u305a\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n  <\/p>\n<pre><code>SET FOREIGN_KEY_CHECKS = 1;<\/code><\/pre>\n<hr \/>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\n    <strong>foreign key constraint violation<\/strong>\u306f\u6016\u3044\u30a8\u30e9\u30fc\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n    <strong>\u53c2\u7167\u6574\u5408\u6027<\/strong>\u304c\u30c7\u30fc\u30bf\u3092\u5b88\u3063\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>    \u958b\u767a\u74b0\u5883\u306a\u3089\n  <\/p>\n<pre><code>SET FOREIGN_KEY_CHECKS = 0;<\/code><\/pre>\n<p>\n    \u3067\u7a81\u7834\u3067\u304d\u307e\u3059\u3002<br \/>\n    \u305f\u3060\u3057\u4f7f\u3044\u3069\u3053\u308d\u3092\u9593\u9055\u3048\u306a\u3044\u3053\u3068\u3002<\/p>\n<p>    \u305c\u3072\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30da\u3057\u3066\u3001\u307e\u305a\u306f\u52d5\u304b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\n  <\/p>\n<p>\n    \uff08SQL\u30a8\u30e9\u30fc\u3084\u73fe\u5834\u3067\u306e\u5931\u6557\u56de\u907f\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1283\" target=\"_blank\" rel=\"noopener\">SQL Syntax Error\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\uff5c\u4eca\u3059\u3050\u8a66\u305b\u308b\u30a8\u30e9\u30fc\u89e3\u6c7a\u6cd5<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aforeign key constraint violation<\/strong><br \/>\n      \u5916\u90e8\u30ad\u30fc\u5236\u7d04\u9055\u53cd\u3002\u89aa\u5b50\u95a2\u4fc2\u306e\u77db\u76fe\u3084\u53c2\u7167\u5148\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<\/div>\n","protected":false},"featured_media":1899,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1898"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1899"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}