{"id":58,"date":"2023-01-20T08:23:01","date_gmt":"2023-06-09T04:05:26","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/"},"modified":"2025-07-31T13:43:29","modified_gmt":"2025-07-31T04:43:29","slug":"mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/","title":{"rendered":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002"},"content":{"rendered":"<p>\u8457\u8005\u306f\u3001Write for DOnations\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u305f\u3081\u306bDiversity in Tech Fund\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u5c0e\u5165<\/h3>\n<p>\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068Structured Query Language\uff08SQL\uff09\u3092\u4f7f\u7528\u3057\u3066\u4f5c\u696d\u3059\u308b\u969b\u3001\u30c7\u30fc\u30bf\u306e\u307b\u3068\u3093\u3069\u306e\u64cd\u4f5c\u306f\u660e\u793a\u7684\u306b\u5b9f\u884c\u3055\u308c\u305f\u30af\u30a8\u30ea\uff08SELECT\u3001INSERT\u3001\u307e\u305f\u306fUPDATE\u306a\u3069\uff09\u306e\u7d50\u679c\u3068\u3057\u3066\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001SQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u306f\u3001\u30c8\u30ea\u30ac\u3092\u901a\u3058\u3066\u7279\u5b9a\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u4e8b\u524d\u5b9a\u7fa9\u3055\u308c\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3059\u308b\u3088\u3046\u6307\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30c8\u30ea\u30ac\u3092\u4f7f\u7528\u3057\u3066\u3001\u524a\u9664\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u5168\u3066\u306e\u64cd\u4f5c\u30ed\u30b0\u3084\u3001\u884c\u304c\u66f4\u65b0\u307e\u305f\u306f\u8ffd\u52a0\u3055\u308c\u308b\u305f\u3073\u306b\u96c6\u8a08\u7d71\u8a08\u306e\u8981\u7d04\u3092\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u884c\u304c\u633f\u5165\u3055\u308c\u305f\u3001\u66f4\u65b0\u3055\u308c\u305f\u3001\u307e\u305f\u306f\u524a\u9664\u3055\u308c\u305f\u5834\u5408\u306b\u81ea\u52d5\u7684\u306b\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u3001\u7570\u306a\u308bSQL\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30ac\u30a4\u30c9\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001SQL\u30d9\u30fc\u30b9\u306e\u95a2\u4fc2\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\uff08RDBMS\uff09\u304c\u52d5\u4f5c\u3059\u308b\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30ac\u30a4\u30c9\u306e\u624b\u9806\u3068\u4f8b\u306f\u3001\u4ee5\u4e0b\u306e\u74b0\u5883\u3067\u691c\u8a3c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>A server running Ubuntu 20.04, with a non-root user with administrative privileges and a firewall configured with UFW, as described in our initial server setup guide for Ubuntu 20.04.<\/li>\n<li>MySQL installed and secured on the server, as outlined in How To Install MySQL on Ubuntu 20.04. This guide was verified with a non-root MySQL user, created using the process described in Step 3.<\/li>\n<li>Basic familiarity with executing SELECT, INSERT, UPDATE, and DELETE queries to manipulate data in the database as described in our How To SELECT Rows FROM Tables in SQL, How To Insert Data in SQL, How To Update Data in SQL, and How To Delete Data in SQL guides.<\/li>\n<li>Basic familiarity with using nested queries as described in our How To Use Nested Queries in SQL guide.<\/li>\n<li>Basic familiarity with using aggregate mathematical functions as described in our How To Use Mathematical Expressions and Aggregate Functions in SQL guide.<\/li>\n<\/ul>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u591a\u304f\u306eRDBMS\u306f\u3001\u72ec\u81ea\u306eSQL\u306e\u5b9f\u88c5\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u30c8\u30ea\u30ac\u30fc\u306fSQL\u306e\u6a19\u6e96\u306e\u4e00\u90e8\u3068\u3057\u3066\u8a00\u53ca\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u6a19\u6e96\u3067\u306f\u69cb\u6587\u3084\u53b3\u683c\u306a\u5b9f\u88c5\u65b9\u6cd5\u306f\u5f37\u5236\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u7d50\u679c\u3001\u7570\u306a\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u9593\u3067\u306e\u5b9f\u88c5\u306f\u7570\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u306fMySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u4ed6\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u3067\u306f\u52d5\u4f5c\u3057\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3001\u3044\u304f\u3064\u304b\u306e\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u6301\u3064\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3082\u5fc5\u8981\u3067\u3059\u3002\u95a2\u6570\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7df4\u7fd2\u3059\u308b\u305f\u3081\u306b\u306f\u3001MySQL\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3001\u3053\u306e\u30ac\u30a4\u30c9\u5168\u4f53\u3067\u4f7f\u7528\u3055\u308c\u308b\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u7d30\u306a\u624b\u9806\u304c\u3001\u4ee5\u4e0b\u306e\u300cMySQL\u3078\u306e\u63a5\u7d9a\u3068\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>MySQL\u3078\u306e\u63a5\u7d9a\u3068\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001MySQL\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3001\u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306e\u4f8b\u306b\u5f93\u3063\u3066\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u6848\u5185\u3067\u306f\u3001\u67b6\u7a7a\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u73fe\u5728\u6240\u6709\u3057\u3066\u3044\u308b\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u306e\u8a73\u7d30\u3092\u4fdd\u5b58\u3057\u3001\u7dcf\u984d\u3092\u3059\u3050\u306b\u5229\u7528\u53ef\u80fd\u306b\u3057\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u524a\u9664\u3057\u3066\u3082\u5e38\u306b\u75d5\u8de1\u304c\u6b8b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3042\u306a\u305f\u306eSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b7\u30b9\u30c6\u30e0\u304c\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u7a3c\u50cd\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u306bSSH\u63a5\u7d9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ssh<\/span> <mark>sammy<\/mark>@<mark>your_server_ip<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001MySQL\u30b5\u30fc\u30d0\u30fc\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u958b\u304d\u3001MySQL\u306e\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\u3067\u3042\u308b\u300csammy\u300d\u3092\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">mysql <span class=\"token parameter variable\">-u<\/span> <mark>sammy<\/mark> <span class=\"token parameter variable\">-p<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE DATABASE collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3082\u3057\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u305f\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.01 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306eUSE\u6587\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">USE collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059: (Shita no shutsuryoku o uketorimasu)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Database changed<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3057\u305f\u5f8c\u3001\u305d\u306e\u4e2d\u306b\u30b5\u30f3\u30d7\u30eb\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u300c\u53ce\u96c6\u54c1\u300d\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u53ce\u96c6\u54c1\u306b\u95a2\u3059\u308b\u7c21\u7565\u306a\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002\u6b21\u306e\u30ab\u30e9\u30e0\u304c\u542b\u307e\u308c\u307e\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>name: This column holds the name for each collectible, expressed using the varchar data type with a maximum of 50 characters.<\/li>\n<li>value: This column stores the collectible\u2019s market value using the decimal data type with a maximum of 5 values before the decimal point and 2 values after it.<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30f3\u30d7\u30eb\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TABLE collectibles <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"mysql&gt;\">name varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">value decimal<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span>, <span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3082\u3057\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u308b\u306a\u3089\u3070\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 rows affected (0.00 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u30c6\u30fc\u30d6\u30eb\u306fcollectibles_stats\u3068\u547c\u3070\u308c\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5185\u306e\u3059\u3079\u3066\u306e\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u306e\u7d2f\u7a4d\u4fa1\u5024\u3092\u8ffd\u8de1\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30ab\u30e9\u30e0\u3092\u6301\u3064\u5358\u4e00\u306e\u30c7\u30fc\u30bf\u884c\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>count: This column holds the number of owned collectibles, expressed using the int data type.<\/li>\n<li>value: This column stores the accumulated worth of all collectibles using the decimal data type with a maximum of 5 values before the decimal point and 2 values after it.<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30f3\u30d7\u30eb\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TABLE collectibles_stats <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"mysql&gt;\">count int,<\/li>\n<li data-prefix=\"mysql&gt;\">value decimal<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span>, <span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3082\u3057\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u305f\u3089\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 rows affected (0.00 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u7b2c\u4e09\u30c6\u30fc\u30d6\u30eb\u306fcollectibles_archive\u3068\u547c\u3070\u308c\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304b\u3089\u524a\u9664\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u30b3\u30ec\u30af\u30c6\u30a3\u30d6\u30eb\u306e\u8ffd\u8de1\u3092\u884c\u3044\u3001\u305d\u308c\u3089\u304c\u6d88\u3048\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306fcollectibles\u30c6\u30fc\u30d6\u30eb\u3068\u4f3c\u305f\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u3001\u524a\u9664\u3055\u308c\u305f\u65e5\u4ed8\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u5217\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>name: This column holds the name for each removed collectible, expressed using the varchar data type with a maximum of 50 characters.<\/li>\n<li>value: This column stores the collectible\u2019s market value at the moment of deletion using the decimal data type with a maximum of 5 values before the decimal point and 2 values after it.<\/li>\n<li>removed_on: This column stores the date and time of deletion for each archived collectible using the timestamp data type with the default value of NOW(), meaning the current date whenever a new row is inserted into this table.<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TABLE collectibles_archive <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"mysql&gt;\">name varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">value decimal<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span>, <span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"mysql&gt;\">removed_on timestamp DEFAULT CURRENT_TIMESTAMP<\/li>\n<li data-prefix=\"mysql&gt;\"><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3082\u3057\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u308b\u306a\u3089\u3001\u30c6\u30fc\u30d6\u30eb\u306f\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 rows affected (0.00 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u6b21\u306eINSERT INTO\u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u3066\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u521d\u671f\u72b6\u614b\u3067\u3042\u308b\u7a7a\u306ecollectibles_stats\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO collectibles_stats SELECT COUNT<span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">)<\/span>, SUM<span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span> FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>INSERT INTO\u64cd\u4f5c\u306f\u3001\u96c6\u3081\u3089\u308c\u305f\u53ce\u96c6\u54c1\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5358\u4e00\u306e\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u306e\u884c\u306e\u5024\u306f\u3001\u53ce\u96c6\u54c1\u30c6\u30fc\u30d6\u30eb\u306e\u3059\u3079\u3066\u306e\u884c\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u305f\u3081\u306e\u96c6\u8a08\u95a2\u6570\u3068\u3001value\u5217\u3068SUM\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u53ce\u96c6\u54c1\u306e\u4fa1\u5024\u306e\u5408\u8a08\u3092\u8a08\u7b97\u3057\u305f\u7d50\u679c\u3067\u3059\u3002\u6b21\u306e\u51fa\u529b\u306f\u3001\u884c\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.002 sec) Records: 1 Duplicates: 0 Warnings: 0<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c6\u30fc\u30d6\u30eb\u4e0a\u3067SELECT\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u308c\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_stats<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u307e\u3060\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u304c\u306a\u3044\u305f\u3081\u3001\u30a2\u30a4\u30c6\u30e0\u306e\u521d\u671f\u6570\u306f0\u3067\u3001\u7d2f\u7a4d\u3057\u305f\u5024\u306fNULL\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;-+&#8212;&#8212;-+ | count | value | +&#8212;&#8212;-+&#8212;&#8212;-+ | 0 | NULL | +&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u3067\u306f\u3001\u3042\u306a\u305f\u306f\u3053\u306e\u30ac\u30a4\u30c9\u306e\u6b8b\u308a\u3092\u8ffd\u3044\u3001MySQL\u3067\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u59cb\u3081\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30c8\u30ea\u30ac\u30fc\u306e\u7406\u89e3<\/h2>\n<p>\u30c8\u30ea\u30ac\u30fc\u306f\u3001\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3042\u308a\u3001\u305d\u306e\u30c6\u30fc\u30d6\u30eb\u5185\u3067\u7279\u5b9a\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3059\u308b\u305f\u3073\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u30c8\u30ea\u30ac\u30fc\u306f\u3001\u7279\u5b9a\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u30c6\u30fc\u30d6\u30eb\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3073\u306b\u3001\u4e00\u8cab\u3057\u3066\u7279\u5b9a\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u305d\u308c\u3092\u624b\u52d5\u3067\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u899a\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u3059\u3079\u3066\u306e\u30c8\u30ea\u30ac\u30fc\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u306e\u540d\u524d\u3068\u30c8\u30ea\u30ac\u30fc\u3092\u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u6307\u793a\u3059\u308b\u4e00\u7d44\u306e\u6761\u4ef6\u3067\u8b58\u5225\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u4e8c\u3064\u306e\u5225\u3005\u306e\u30af\u30e9\u30b9\u306b\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>Database event: The trigger can be executed when INSERT, UPDATE, or DELETE statements are run on a table.<\/li>\n<li>Event time: Additionally, triggers can be executed BEFORE or AFTER the statement in question.<\/li>\n<\/ul>\n<p>2\u3064\u306e\u6761\u4ef6\u30b0\u30eb\u30fc\u30d7\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u5408\u8a086\u3064\u306e\u7570\u306a\u308b\u30c8\u30ea\u30ac\u30fc\u306e\u53ef\u80fd\u6027\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30c8\u30ea\u30ac\u30fc\u306f\u3001\u5171\u6709\u306e\u6761\u4ef6\u304c\u6e80\u305f\u3055\u308c\u308b\u305f\u3073\u306b\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u6761\u4ef6\u3092\u6e80\u305f\u3059\u524d\u306b\u767a\u751f\u3059\u308b\u30c8\u30ea\u30ac\u30fc\u306b\u306f\u3001BEFORE INSERT\u3001BEFORE UPDATE\u3001BEFORE DELETE\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u30c7\u30fc\u30bf\u304c\u30c6\u30fc\u30d6\u30eb\u306b\u633f\u5165\u307e\u305f\u306f\u66f4\u65b0\u3055\u308c\u308b\u524d\u306b\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u304a\u3088\u3073\u691c\u8a3c\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u524a\u9664\u3055\u308c\u305f\u884c\u306e\u8a73\u7d30\u3092\u76e3\u67fb\u307e\u305f\u306f\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u76ee\u7684\u3067\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6761\u4ef6\u306b\u5408\u81f4\u3059\u308b\u6587\u306e\u5b9f\u884c\u5f8c\u306b\u767a\u751f\u3059\u308b\u30c8\u30ea\u30ac\u30fc\u306f\u3001AFTER INSERT\u3001AFTER UPDATE\u3001\u304a\u3088\u3073AFTER DELETE\u3067\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u6587\u306e\u5b9f\u884c\u5f8c\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6700\u7d42\u72b6\u614b\u306b\u57fa\u3065\u3044\u3066\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u96c6\u8a08\u5024\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c8\u30ea\u30ac\u30fc\u5185\u304b\u3089\u30c7\u30fc\u30bf\u306e\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5165\u529b\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u3084\u64cd\u4f5c\u3001\u524a\u9664\u3055\u308c\u305f\u884c\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u306a\u3069\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002INSERT\u30c8\u30ea\u30ac\u30fc\u3067\u306f\u3001\u65b0\u3057\u304f\u633f\u5165\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002UPDATE\u30c8\u30ea\u30ac\u30fc\u3067\u306f\u3001\u5143\u306e\u30c7\u30fc\u30bf\u3068\u66f4\u65b0\u5f8c\u306e\u30c7\u30fc\u30bf\u306e\u4e21\u65b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001DELETE\u30c8\u30ea\u30ac\u30fc\u3067\u306f\u524a\u9664\u3055\u308c\u305f\u884c\u306e\u5143\u306e\u30c7\u30fc\u30bf\u306e\u307f\u304c\u5229\u7528\u53ef\u80fd\u3067\u3059\uff08\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u304c\u53c2\u7167\u3067\u304d\u306a\u3044\u305f\u3081\uff09\u3002<\/p>\n<p>\u30c8\u30ea\u30ac\u672c\u4f53\u5185\u3067\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306fOLD\u30ec\u30b3\u30fc\u30c9\u3001\u30af\u30a8\u30ea\u304c\u4fdd\u5b58\u3059\u308b\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306fNEW\u30ec\u30b3\u30fc\u30c9\u306e\u4e0b\u306b\u516c\u958b\u3055\u308c\u307e\u3059\u3002\u500b\u3005\u306e\u5217\u306b\u306f\u3001OLD.column_name\u304a\u3088\u3073NEW.column_name\u3068\u3044\u3046\u69cb\u6587\u3092\u4f7f\u3063\u3066\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u4f8b\u306f\u3001\u65b0\u3057\u3044\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308bSQL\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u4e00\u822c\u7684\u306a\u69cb\u6587\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>trigger_name<\/mark> <mark>trigger_condition<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON <mark>table_name<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>trigger_actions<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6587\u6cd5\u3092\u5c0f\u3055\u306a\u90e8\u5206\u306b\u5206\u89e3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul class=\"post-ul\">\n<li>CREATE TRIGGER is the name of the SQL statement used to create a new trigger in the database.<\/li>\n<li>trigger_name is the user-defined name of the trigger, used to describe its role, similar to how table names and column names are used to describe their meaning.<\/li>\n<li>ON table_name tells the database that the trigger should monitor events happening on the table_name table.<\/li>\n<li>trigger_condition is one of the six possible choices defining when the trigger should run, for example, BEFORE INSERT.<\/li>\n<li>FOR EACH ROW tells the database that the trigger should be run for each row affected by the triggering event. Some databases support additional patterns of execution other than FOR EACH ROW; however, in the case of MySQL, running the statements from the trigger body for each row affected by the statement that caused the trigger to execute is the only option.<\/li>\n<li>trigger_actions is the trigger\u2019s body and defines what happens when the trigger executes. It\u2019s typically a single valid SQL statement. It is possible to include multiple statements in the trigger body to perform complex data operations using the BEGIN and END keywords to enclose the list of statements in a block. This is, however, out of the scope of this tutorial. Check out the official documentation for triggers to learn more about the syntax used to define triggers.<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001INSERT\u304a\u3088\u3073UPDATE\u64cd\u4f5c\u524d\u306b\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h2>BEFORE INSERT \u3068 BEFORE UPDATE \u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u3002<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001INSERT\u304a\u3088\u3073UPDATE\u6587\u304c\u5b9f\u884c\u3055\u308c\u308b\u524d\u306b\u3001\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u3059\u3079\u3066\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304c\u4e00\u8cab\u6027\u306e\u3042\u308b\u5927\u6587\u5b57\u306e\u540d\u79f0\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u306a\u3044\u5834\u5408\u3001\u5404INSERT\u304a\u3088\u3073UPDATE\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u5927\u6587\u5b57\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u540d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u899a\u3048\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u5fd8\u308c\u308b\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307e\u4fdd\u5b58\u3057\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u53ef\u80fd\u306a\u30df\u30b9\u3092\u5f15\u304d\u8d77\u3053\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u300112.50\u30c9\u30eb\u306e\u4fa1\u5024\u304c\u3042\u308b\u5b87\u5b99\u8239\u30e2\u30c7\u30eb\u3068\u3044\u3046\u4f8b\u306e\u30b3\u30ec\u30af\u30bf\u30fc\u30a2\u30a4\u30c6\u30e0\u3092\u633f\u5165\u3057\u307e\u3059\u3002\u554f\u984c\u3092\u793a\u3059\u305f\u3081\u306b\u3001\u30a2\u30a4\u30c6\u30e0\u540d\u306f\u5c0f\u6587\u5b57\u3067\u66f8\u304b\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO collectibles VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8216;<mark>spaceship model<\/mark>&#8216;<\/span>, <span class=\"token number\">12.50<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u3001\u30a2\u30a4\u30c6\u30e0\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>SELECT\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3066\u3001\u884c\u304c\u633f\u5165\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | <mark>spaceship model<\/mark> | 12.50 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u306f\u3001\u305d\u306e\u307e\u307e\u306e\u5f62\u3067\u4fdd\u5b58\u3055\u308c\u3001\u540d\u524d\u306f\u3059\u3079\u3066\u5c0f\u6587\u5b57\u3067\u30b9\u30da\u30eb\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u5c06\u6765\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u304c\u5e38\u306b\u5927\u6587\u5b57\u3067\u66f8\u304b\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001BEFORE INSERT\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u30fc\u306f\u3001\u30c8\u30ea\u30ac\u30ea\u30f3\u30b0\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u5b9f\u884c\u3055\u308c\u308b\u524d\u306b\u30c7\u30fc\u30bf\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u6e21\u3059\u524d\u306b\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u30c8\u30ea\u30ac\u30ea\u30f3\u30b0\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u6587\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>uppercase_before_insert BEFORE INSERT<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SET NEW.name <span class=\"token operator\">=<\/span> UPPER<span class=\"token punctuation\">(<\/span>NEW.name<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001collectibles\u3068\u3044\u3046\u540d\u524d\u306e\u30c6\u30fc\u30d6\u30eb\u4e0a\u306e\u3059\u3079\u3066\u306eINSERT\u6587\u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u308btrigger\u3067\u3042\u308buppercase_before_insert\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c8\u30ea\u30ac\u30fc\u5185\u306e\u6587\u300cSET NEW.name = UPPER(NEW.name)\u300d\u306f\u3001\u633f\u5165\u3055\u308c\u308b\u884c\u3054\u3068\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002SET SQL\u30b3\u30de\u30f3\u30c9\u306f\u53f3\u8fba\u306e\u5024\u3092\u5de6\u8fba\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001NEW.name\u306f\u633f\u5165\u6587\u306b\u4fdd\u5b58\u3055\u308c\u308b\u540d\u524d\u5217\u306e\u5024\u3092\u8868\u3057\u307e\u3059\u3002\u53ce\u96c6\u53ef\u80fd\u306a\u540d\u524d\u306b\u5bfe\u3057\u3066UPPER\u95a2\u6570\u3092\u9069\u7528\u3057\u3001\u30ab\u30e9\u30e0\u306e\u5024\u306b\u623b\u3057\u3066\u3044\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u308b\u5024\u306e\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-warning\">\n<p class=\"post-conf-desc\">Warning<\/p>\n<div>\u6ce8\u610f: CREATE TRIGGER\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u3001ERROR 1419 (HY000): You do not have the SUPER privilege, and binary logging is enabled\u3068\u3044\u3046\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\uff08log_bin_trust_function_creators\u5909\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff09\u3002<br \/>\nMySQL 8\u4ee5\u964d\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u30ed\u30fc\u30ab\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u8a2d\u5b9a\u3067\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u9664\u5916\u3055\u308c\u307e\u3059\u3002\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u306f\u3001\u4fee\u6b63\u5185\u5bb9\u3092\u8a18\u8ff0\u3057\u305f\u4fdd\u5b58\u30a4\u30d9\u30f3\u30c8\u306e\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3059\u3079\u3066\u306eSQL\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u8ffd\u8de1\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30ed\u30b0\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3055\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30ec\u30d7\u30ea\u30ab\u3092\u540c\u671f\u3057\u3001\u30dd\u30a4\u30f3\u30c8\u30a4\u30f3\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u306e\u30ea\u30ab\u30d0\u30ea\u4e2d\u306b\u3082\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<br \/>\n\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u3001MySQL\u306f\u30c7\u30fc\u30bf\u306e\u5b89\u5168\u6027\u3068\u6574\u5408\u6027\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306b\u3001\u30c8\u30ea\u30ac\u3084\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u4f5c\u6210\u3092\u4e88\u9632\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u3084\u30b9\u30c8\u30a2\u30c9\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u304c\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3069\u306e\u3088\u3046\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u304b\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u306f\u3001\u3053\u306e\u30ac\u30a4\u30c9\u306e\u7bc4\u56f2\u5916\u3067\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3084\u5b66\u7fd2\u76ee\u7684\u306e\u5834\u5408\u306f\u3001MySQL\u304c\u30c8\u30ea\u30ac\u306e\u4f5c\u6210\u3092\u9632\u3050\u65b9\u6cd5\u3092\u5b89\u5168\u306b\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3055\u308c\u305f\u8a2d\u5b9a\u306f\u6c38\u7d9a\u5316\u3055\u308c\u305a\u3001MySQL\u30b5\u30fc\u30d0\u30fc\u304c\u518d\u8d77\u52d5\u3059\u308b\u3068\u5143\u306e\u5024\u306b\u623b\u308a\u307e\u3059\u3002<br \/>\n\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u306b\u306f\u3001root\u3068\u3057\u3066MySQL\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\uff1a<br \/>\nSET GLOBAL log_bin_trust_function_creators = 1;<\/div>\n<p>log_bin_trust_function_creators\u306e\u8a2d\u5b9a\u306f\u3001\u30c8\u30ea\u30ac\u3084\u30b9\u30c8\u30a2\u30c9\u95a2\u6570\u3092\u4f5c\u6210\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u304c\u3001\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u306b\u5b89\u5168\u3067\u306a\u3044\u30a4\u30d9\u30f3\u30c8\u3092\u66f8\u304d\u8fbc\u3080\u30c8\u30ea\u30ac\u3092\u4f5c\u6210\u3057\u306a\u3044\u3053\u3068\u3092\u4fe1\u983c\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u8a2d\u5b9a\u306e\u5024\u306f0\u3067\u3042\u308a\u3001\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u304c\u6709\u52b9\u306a\u74b0\u5883\u3067\u306f\u30b9\u30fc\u30d1\u30fc\u30e6\u30fc\u30b6\u30fc\u306e\u307f\u304c\u30c8\u30ea\u30ac\u3092\u4f5c\u6210\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5024\u30921\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3001CREATE TRIGGER\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u767a\u884c\u3059\u308b\u4efb\u610f\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u95a2\u9023\u3059\u308b\u5f71\u97ff\u3092\u7406\u89e3\u3067\u304d\u308b\u3068\u4fe1\u983c\u3055\u308c\u307e\u3059\u3002<br \/>\n\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u305f\u3089\u3001root\u3068\u3057\u3066\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u518d\u30ed\u30b0\u30a4\u30f3\u3057\u3001CREATE TRIGGER\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\nMySQL\u306e\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u3068\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u3001\u304a\u3088\u3073\u30c8\u30ea\u30ac\u3068\u306e\u95a2\u9023\u6027\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u5b66\u3076\u306b\u306f\u3001\u516c\u5f0fMySQL\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u300cThe Binary Log and Stored Program Binary Logging\u300d\u3068\u3044\u3046\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u5f53\u793e\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u300cHow to Set Up Replication in MySQL\u300d\u3082\u3054\u89a7\u3044\u305f\u3060\u3051\u307e\u3059\u3002<br \/>\n\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u672c\u756a\u74b0\u5883\u3084\u53b3\u683c\u306a\u30dd\u30a4\u30f3\u30c8\u30a4\u30f3\u30bf\u30a4\u30e0\u30ea\u30ab\u30d0\u30ea\u306e\u8981\u4ef6\u3067\u30c8\u30ea\u30ac\u3092\u4f7f\u7528\u3059\u308b\u524d\u306b\u3001\u30d0\u30a4\u30ca\u30ea\u30ed\u30b0\u306e\u4e00\u8cab\u6027\u306b\u4e0e\u3048\u308b\u5f71\u97ff\u3092\u5341\u5206\u306b\u8003\u616e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1aMySQL\u306e\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u306b\u3088\u3063\u3066\u306f\u3001CREATE TRIGGER\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\uff1aERROR 1142\uff0842000\uff09\uff1a\u30e6\u30fc\u30b6\u30fc&#8217;user&#8217;@&#8217;host&#8217;\u304c&#8217;table&#8217;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eTRIGGER\u30b3\u30de\u30f3\u30c9\u3092\u62d2\u5426\u3055\u308c\u307e\u3057\u305f\u3002\u30e6\u30fc\u30b6\u30fc\u306bTRIGGER\u6a29\u9650\u3092\u4ed8\u4e0e\u3059\u308b\u306b\u306f\u3001MySQL\u306broot\u3068\u3057\u3066\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066MySQL\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30db\u30b9\u30c8\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1a<br \/>\nGRANT TRIGGER on *.* TO &#8216;sammy&#8217;@&#8217;localhost&#8217;;<br \/>\nFLUSH PRIVILEGES;<\/div>\n<p>\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3092\u66f4\u65b0\u3057\u305f\u3089\u3001root\u3068\u3057\u3066\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u518d\u30ed\u30b0\u30a4\u30f3\u3057\u3001CREATE TRIGGER\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<p>MySQL\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u5ea6\u306f\u3001\u5c0f\u6587\u5b57\u306e\u5f15\u6570\u3092\u4f7f\u7528\u3057\u3066INSERT\u30af\u30a8\u30ea\u306b\u65b0\u3057\u3044\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u3092\u633f\u5165\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO collectibles VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8216;<mark>aircraft model<\/mark>&#8216;<\/span>, <span class=\"token number\">10.00<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u3057\u3066\u3082\u3046\u4e00\u5ea6\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u679c\u884c\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | spaceship model | 12.50 | | <mark>AIRCRAFT MODEL<\/mark> | 10.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 2 rows in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u56de\u306f\u3001\u65b0\u898f\u767b\u9332\u306b\u300cAIRCRAFT MODEL\u300d\u3068\u5168\u3066\u5927\u6587\u5b57\u3067\u66f8\u304b\u308c\u305f\u9805\u76ee\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u306f\u3042\u306a\u305f\u304c\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u305f\u9805\u76ee\u3068\u306f\u7570\u306a\u308a\u307e\u3059\u3002\u30c8\u30ea\u30ac\u30fc\u304c\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3055\u308c\u3001\u884c\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u308b\u524d\u306b\u6587\u5b57\u306e\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u5909\u63db\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u65b0\u3057\u3044\u884c\u306f\u3059\u3079\u3066\u3001\u30c8\u30ea\u30ac\u30fc\u306b\u3088\u3063\u3066\u4fdd\u8b77\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u540d\u524d\u304c\u3059\u3079\u3066\u5927\u6587\u5b57\u3067\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u304c\u4fdd\u8a3c\u3055\u308c\u307e\u3059\u3002\u305f\u3060\u3057\u3001UPDATE\u6587\u3092\u4f7f\u7528\u3057\u3066\u5236\u9650\u306e\u306a\u3044\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3082\u307e\u3060\u53ef\u80fd\u3067\u3059\u3002\u540c\u3058\u52b9\u679c\u3067UPDATE\u6587\u3092\u4fdd\u8b77\u3059\u308b\u306b\u306f\u3001\u5225\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>uppercase_before_update BEFORE UPDATE<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SET NEW.name <span class=\"token operator\">=<\/span> UPPER<span class=\"token punctuation\">(<\/span>NEW.name<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e8c\u3064\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u9055\u3044\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u306e\u57fa\u6e96\u306b\u3042\u308a\u307e\u3059\u3002\u4eca\u56de\u306f\u3001BEFORE UPDATE\u3068\u3044\u3046\u610f\u5473\u3067\u3001\u30c8\u30ea\u30ac\u30fc\u306f\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066UPDATE\u6587\u304c\u767a\u884c\u3055\u308c\u308b\u305f\u3073\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u524d\u306e\u30c8\u30ea\u30ac\u30fc\u3067\u30ab\u30d0\u30fc\u3055\u308c\u305f\u65b0\u3057\u3044\u884c\u306b\u52a0\u3048\u3066\u3001\u65e2\u5b58\u306e\u884c\u3082\u66f4\u65b0\u306e\u90fd\u5ea6\u5f71\u97ff\u3092\u53d7\u3051\u307e\u3059\u3002<\/p>\n<p>MySQL\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u65b0\u3057\u3044\u30c8\u30ea\u30ac\u30fc\u306e\u632f\u308b\u821e\u3044\u3092\u691c\u8a3c\u3059\u308b\u305f\u3081\u306b\u3001\u5b87\u5b99\u8239\u30e2\u30c7\u30eb\u306e\u4fa1\u683c\u5024\u3092\u66f4\u65b0\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">UPDATE collectibles SET value <span class=\"token operator\">=<\/span> <span class=\"token number\">15.00<\/span> WHERE name <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8216;<mark>spaceship model<\/mark>&#8216;<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>WHERE\u53e5\u306f\u540d\u524d\u306b\u3088\u3063\u3066\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b\u884c\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u3001SET\u53e5\u306f\u5024\u309215.00\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\u305d\u306e\u7d50\u679c\u3001\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u4e00\u884c\u3060\u3051\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u304c\u78ba\u8a8d\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.002 sec) Rows matched: 1 Changed: 1 Warnings: 0<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u679c\u884c\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | <mark>SPACESHIP MODEL<\/mark> | <mark>15.00<\/mark> | | AIRCRAFT MODEL | 10.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 2 rows in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001\u5b9f\u884c\u3055\u308c\u305f\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306b\u3088\u3063\u3066\u4fa1\u683c\u304c15.00\u306b\u66f4\u65b0\u3055\u308c\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u540d\u524d\u306f\u73fe\u5728\u300cSPACESHIP MODEL\u300d\u3068\u8868\u8a18\u3055\u308c\u3066\u3044\u307e\u3059\u3002UPDATE\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30c8\u30ea\u30ac\u30fc\u304c\u5b9f\u884c\u3055\u308c\u3001\u66f4\u65b0\u3055\u308c\u305f\u884c\u306e\u5024\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u307e\u3059\u3002\u540d\u524d\u306e\u30ab\u30e9\u30e0\u306f\u4fdd\u5b58\u524d\u306b\u5927\u6587\u5b57\u306b\u5909\u63db\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30c7\u30fc\u30bf\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u524d\u306b\u3001INSERT\u304a\u3088\u3073UPDATE\u30af\u30a8\u30ea\u306e\u524d\u3067\u52d5\u4f5c\u3059\u308b2\u3064\u306e\u30c8\u30ea\u30ac\u3092\u4f5c\u6210\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092\u6574\u5f62\u3057\u307e\u3057\u305f\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001BEFORE DELETE\u30c8\u30ea\u30ac\u3092\u4f7f\u7528\u3057\u3066\u3001\u524a\u9664\u3055\u308c\u305f\u884c\u3092\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30b3\u30d4\u30fc\u3057\u3066\u30a2\u30fc\u30ab\u30a4\u30d6\u3057\u307e\u3059\u3002<\/p>\n<h2>\u884c\u3092\u524a\u9664\u3059\u308b\u524d\u306b\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306bBEFORE DELETE\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3002<\/h2>\n<p>\u30a2\u30a4\u30c6\u30e0\u3092\u6301\u3063\u3066\u3044\u306a\u304f\u3066\u3082\u3001\u524a\u9664\u306b\u95a2\u3059\u308b\u30a8\u30f3\u30c8\u30ea\u3092\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u6b8b\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u59cb\u3081\u306b\u3001\u524a\u9664\u3055\u308c\u305f\u53ce\u96c6\u54c1\u306e\u5c65\u6b74\u3092\u8ffd\u8de1\u3059\u308b\u305f\u3081\u306bcollectibles_archive\u3068\u3044\u30462\u756a\u76ee\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001DELETE\u6587\u306e\u5b9f\u884c\u524d\u306b\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u524a\u9664\u3055\u308c\u305f\u30a8\u30f3\u30c8\u30ea\u3092\u30a2\u30fc\u30ab\u30a4\u30d6\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u6587\u3092\u5b9f\u884c\u3057\u3066\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u30c6\u30fc\u30d6\u30eb\u304c\u5b8c\u5168\u306b\u7a7a\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_archive<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u3001collectibles_archive\u30c6\u30fc\u30d6\u30eb\u304c\u7a7a\u3067\u3042\u308b\u3053\u3068\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Empty set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u3066DELETE\u30af\u30a8\u30ea\u3092\u767a\u884c\u3059\u308b\u3068\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u4efb\u610f\u306e\u884c\u304c\u75d5\u8de1\u306a\u304f\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u3001\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u30c6\u30fc\u30d6\u30eb\u306e\u3059\u3079\u3066\u306eDELETE\u30af\u30a8\u30ea\u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u76ee\u7684\u306f\u3001\u524a\u9664\u304c\u884c\u308f\u308c\u308b\u524d\u306b\u524a\u9664\u3055\u308c\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30d4\u30fc\u3092\u30a2\u30fc\u30ab\u30a4\u30d6\u30c6\u30fc\u30d6\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>archive_before_delete BEFORE DELETE<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>INSERT INTO collectibles_archive <span class=\"token punctuation\">(<\/span>name, value<span class=\"token punctuation\">)<\/span> VALUES <span class=\"token punctuation\">(<\/span>OLD.name, OLD.value<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c8\u30ea\u30ac\u30fc\u306f\u300carchive_before_delete\u300d\u3068\u3044\u3046\u540d\u524d\u3067\u3042\u308a\u3001collectibles\u30c6\u30fc\u30d6\u30eb\u4e0a\u306eDELETE\u30af\u30a8\u30ea\u306e\u524d\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u524a\u9664\u3055\u308c\u308b\u5404\u884c\u306b\u5bfe\u3057\u3066\u3001INSERT\u6587\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u305d\u306eINSERT\u6587\u306f\u3001\u524a\u9664\u5bfe\u8c61\u306e\u53e4\u3044\u30ec\u30b3\u30fc\u30c9\u3001\u3064\u307e\u308aOLD\u30ec\u30b3\u30fc\u30c9\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u5024\u3067collectibles_archive\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u3057\u3044\u884c\u3092\u633f\u5165\u3057\u307e\u3059\u3002OLD.name\u306fname\u5217\u3068\u3057\u3066\u3001OLD.value\u306fvalue\u5217\u3068\u3057\u3066\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u30c8\u30ea\u30ac\u30fc\u306e\u4f5c\u6210\u304c\u78ba\u8a8d\u3055\u308c\u307e\u3059\u3002 (D\u0113tab\u0113su wa torig\u0101 no sakusei ga kakunin sa remasu.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c8\u30ea\u30ac\u30fc\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u72b6\u614b\u3067\u3001\u30e1\u30a4\u30f3\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u524a\u9664\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">DELETE FROM collectibles WHERE name <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8216;<mark>SPACESHIP MODEL<\/mark>&#8216;<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u306f\u3001\u30af\u30a8\u30ea\u304c\u6b63\u5e38\u306b\u5b9f\u884c\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.004 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u5168\u3066\u306e\u53ce\u96c6\u54c1\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+ | AIRCRAFT MODEL | 10.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u306f\u822a\u7a7a\u6a5f\u306e\u30e2\u30c7\u30eb\u306e\u307f\u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u5b87\u5b99\u8239\u306e\u30e2\u30c7\u30eb\u306f\u524a\u9664\u3055\u308c\u3001\u3082\u306f\u3084\u30c6\u30fc\u30d6\u30eb\u306b\u5b58\u5728\u3057\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u3001\u4ee5\u524d\u306b\u4f5c\u6210\u3055\u308c\u305f\u30c8\u30ea\u30ac\u30fc\u306b\u3088\u3063\u3066\u3001\u3053\u306e\u524a\u9664\u306f\u53ce\u96c6\u54c1\u30a2\u30fc\u30ab\u30a4\u30d6\u30c6\u30fc\u30d6\u30eb\u306b\u767b\u9332\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002\u305d\u308c\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3082\u3046\u4e00\u3064\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (M\u014d hitotsu no kueri o jikk\u014d shite kudasai.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_archive<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | name | value | removed_on | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ | <mark>SPACESHIP MODEL<\/mark> | 15.00 | 2022-11-20 11:32:01 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c8\u30ea\u30ac\u30fc\u306b\u3088\u3063\u3066\u3001\u524a\u9664\u306f\u81ea\u52d5\u7684\u306b\u305d\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u8a18\u9332\u3055\u308c\u307e\u3057\u305f\u3002\u540d\u524d\u5217\u3068\u5024\u5217\u306f\u3001\u524a\u9664\u3055\u308c\u305f\u884c\u306e\u30c7\u30fc\u30bf\u3067\u57cb\u3081\u3089\u308c\u307e\u3057\u305f\u3002\u5b9a\u7fa9\u3055\u308c\u305f\u30c8\u30ea\u30ac\u30fc\u306b\u3088\u3063\u3066\u660e\u793a\u7684\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u30013\u756a\u76ee\u306e\u5217\u3067\u3042\u308bremoved_on\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u6642\u306b\u6c7a\u5b9a\u3055\u308c\u305f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u53d6\u308a\u307e\u3059\u3002\u3053\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u3001\u65b0\u3057\u3044\u884c\u304c\u4f5c\u6210\u3055\u308c\u308b\u65e5\u4ed8\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u8ffd\u52a0\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306f\u3001\u5e38\u306b\u524a\u9664\u65e5\u4ed8\u3067\u6ce8\u91c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u3059\u3079\u3066\u306eDELETE\u30af\u30a8\u30ea\u306b\u3088\u3063\u3066\u6240\u6709\u3057\u3066\u3044\u305f\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u306b\u95a2\u3059\u308b\u60c5\u5831\u304ccollectibles_archive\u306b\u30ed\u30b0\u30a8\u30f3\u30c8\u30ea\u3068\u3057\u3066\u6b8b\u3055\u308c\u308b\u3053\u3068\u304c\u4fdd\u8a3c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u6587\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u5168\u3066\u306e\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u306b\u57fa\u3065\u3044\u3066\u96c6\u8a08\u3055\u308c\u305f\u5024\u3067\u30b5\u30de\u30ea\u30fc\u30c6\u30fc\u30d6\u30eb\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u306e\u64cd\u4f5c\u5f8c\u306b\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u3001AFTER INSERT\u3001AFTER UPDATE\u3001AFTER DELETE \u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/h2>\n<p>\u904e\u53bb\u306e2\u3064\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30e1\u30a4\u30f3\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u524d\u306b\u5b9f\u884c\u3055\u308c\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u66f4\u65b0\u524d\u306e\u5143\u306e\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u610f\u56f3\u3057\u305f\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u5e38\u306b\u6700\u65b0\u306e\u30ab\u30a6\u30f3\u30c8\u3068\u3059\u3079\u3066\u306e\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u306e\u84c4\u7a4d\u4fa1\u5024\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30de\u30ea\u30fc\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u53cd\u6620\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001collectibles_stats\u30c6\u30fc\u30d6\u30eb\u3092\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 (Mazu, collectibles_stats\u30c6\u30fc\u30d6\u30eb\u3092\u3057\u3089\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_stats<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u307e\u3060\u60c5\u5831\u3092\u8ffd\u52a0\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6240\u6301\u3057\u3066\u3044\u308b\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u306e\u6570\u306f0\u3067\u3042\u308a\u3001\u305d\u306e\u305f\u3081\u3001\u8a55\u4fa1\u5024\u3082NULL\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;-+&#8212;&#8212;-+ | count | value | +&#8212;&#8212;-+&#8212;&#8212;-+ | 0 | NULL | +&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u30c8\u30ea\u30ac\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u305f\u3081\u3001\u4ee5\u524d\u306b\u767a\u884c\u3055\u308c\u305f\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u633f\u5165\u3084\u66f4\u65b0\u306e\u30af\u30a8\u30ea\u306f\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u5f71\u97ff\u3092\u4e0e\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>collectibles_stats\u30c6\u30fc\u30d6\u30eb\u5185\u306e1\u884c\u306e\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u500b\u6570\u3068\u7dcf\u4fa1\u5024\u306b\u95a2\u3059\u308b\u6700\u65b0\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u76ee\u6a19\u3067\u3059\u3002INSERT\u3001UPDATE\u3001\u307e\u305f\u306fDELETE\u64cd\u4f5c\u306e\u5f8c\u306b\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u304c\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u3001\u5bfe\u5fdc\u3059\u308b\u30af\u30a8\u30ea\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b3\u3064\u306e\u5225\u3005\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u884c\u3048\u307e\u3059\u3002\u6700\u521d\u306b\u3001AFTER INSERT\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>stats_after_insert AFTER INSERT<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>UPDATE collectibles_stats<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SET count <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT COUNT<span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span>, value <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT SUM<span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c8\u30ea\u30ac\u30fc\u306f\u300cstats_after_insert\u300d\u3068\u3044\u3046\u540d\u524d\u3067\u3042\u308a\u3001collectibles\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u5168\u3066\u306eINSERT\u30af\u30a8\u30ea\u30fc\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u3001\u30c8\u30ea\u30ac\u30fc\u672c\u6587\u306eUPDATE\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u3053\u306eUPDATE\u30af\u30a8\u30ea\u30fc\u306fcollectibles_stats\u3092\u66f4\u65b0\u3057\u3001count\u5217\u3068value\u5217\u306b\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30af\u30a8\u30ea\u30fc\u304b\u3089\u8fd4\u3055\u308c\u305f\u5024\u3092\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>SELECT COUNT(name) FROM collectibles will get the collectibles count.<\/li>\n<li>SELECT SUM(value) FROM collectibles will get the total worth of all collectibles.<\/li>\n<\/ul>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u30c8\u30ea\u30ac\u30fc\u306e\u4f5c\u6210\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 (The database will confirm the creation of the trigger.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3067\u306f\u3001\u4ee5\u524d\u524a\u9664\u3055\u308c\u305f\u5b87\u5b99\u8239\u306e\u6a21\u578b\u3092\u53ce\u96c6\u54c1\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u518d\u633f\u5165\u3057\u3066\u3001\u8981\u7d04\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u6b63\u3057\u304f\u66f4\u65b0\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO collectibles VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8216;spaceship model&#8217;<\/span>, <span class=\"token number\">15.00<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u6210\u529f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c\u6240\u6709\u3057\u3066\u3044\u308b\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u3059\u3079\u3066\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u306b\u306f\u3001\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | AIRCRAFT MODEL | 10.00 | | SPACESHIP MODEL | 15.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 2 rows in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5408\u8a0825.00\u30c9\u30eb\u5206\u306e\u8cb4\u91cd\u306a\u30b3\u30ec\u30af\u30bf\u30fc\u30a2\u30a4\u30c6\u30e0\u304c2\u3064\u3042\u308a\u307e\u3059\u3002\u65b0\u305f\u306b\u633f\u5165\u3055\u308c\u305f\u30a2\u30a4\u30c6\u30e0\u306e\u5f8c\u306b\u3001\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u3066\u8981\u7d04\u30c6\u30fc\u30d6\u30eb\u3092\u8abf\u3079\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_stats<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u56de\u306e\u8981\u7d04\u30c6\u30fc\u30d6\u30eb\u3067\u306f\u3001\u6240\u6709\u3059\u308b\u30b3\u30ec\u30af\u30bf\u30fc\u30a2\u30a4\u30c6\u30e0\u306e\u6570\u304c2\u3067\u3001\u7d2f\u7a4d\u4fa1\u5024\u304c25.00\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u524d\u56de\u306e\u51fa\u529b\u3068\u4e00\u81f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;-+&#8212;&#8212;-+ | count | value | +&#8212;&#8212;-+&#8212;&#8212;-+ | 2 | 25.00 | +&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>INSERT\u30af\u30a8\u30ea\u306e\u5f8c\u306bstats_after_insert\u30c8\u30ea\u30ac\u30fc\u304c\u5b9f\u884c\u3055\u308c\u3001collectibles_stats\u30c6\u30fc\u30d6\u30eb\u304c\u73fe\u5728\u306e\u30c7\u30fc\u30bf\uff08\u6570\u3068\u5024\uff09\u3067\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u95a2\u3059\u308b\u7d71\u8a08\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002\u7d71\u8a08\u306f\u3001\u6700\u5f8c\u306e\u633f\u5165\u3060\u3051\u3067\u306a\u304f\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5168\u4f53\u306e\u5185\u5bb9\u306b\u3064\u3044\u3066\u53ce\u96c6\u3055\u308c\u307e\u3059\u3002\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u306f\u73fe\u5728\u3001\u822a\u7a7a\u6a5f\u3068\u5b87\u5b99\u8239\u306e\u30e2\u30c7\u30eb\u306e2\u3064\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30b5\u30de\u30ea\u30fc\u30c6\u30fc\u30d6\u30eb\u306b\u306f2\u3064\u306e\u30a2\u30a4\u30c6\u30e0\u3068\u305d\u306e\u5408\u8a08\u5024\u304c\u30ea\u30b9\u30c8\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u6642\u70b9\u3067\u3001collectibles\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u3057\u3044\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u6b63\u3057\u3044\u5024\u3067\u30b5\u30de\u30ea\u30fc\u30c6\u30fc\u30d6\u30eb\u304c\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u65e2\u5b58\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u66f4\u65b0\u3057\u305f\u308a\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30a2\u30a4\u30c6\u30e0\u3092\u524a\u9664\u3057\u3066\u3082\u3001\u6982\u8981\u306b\u306f\u5168\u304f\u5f71\u97ff\u3092\u4e0e\u3048\u307e\u305b\u3093\u3002\u305d\u306e\u9699\u9593\u3092\u57cb\u3081\u308b\u305f\u3081\u306b\u3001\u540c\u3058\u64cd\u4f5c\u3092\u884c\u3046\u304c\u7570\u306a\u308b\u30a4\u30d9\u30f3\u30c8\u306b\u3088\u3063\u3066\u30c8\u30ea\u30ac\u30fc\u3055\u308c\u308b2\u3064\u306e\u8ffd\u52a0\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>stats_after_update AFTER UPDATE<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>UPDATE collectibles_stats<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SET count <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT COUNT<span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span>, value <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT SUM<span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><\/li>\n<li data-prefix=\"mysql&gt;\">CREATE TRIGGER <mark>stats_after_delete AFTER DELETE<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\">ON collectibles<\/li>\n<li data-prefix=\"mysql&gt;\">FOR EACH ROW<\/li>\n<li data-prefix=\"mysql&gt;\"><mark>UPDATE collectibles_stats<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SET count <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT COUNT<span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span>, value <span class=\"token operator\">=<\/span> <span class=\"token punctuation\">(<\/span><\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark>SELECT SUM<span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span> FROM collectibles<\/mark><\/li>\n<li data-prefix=\"mysql&gt;\"><mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306f\u73fe\u5728\u3001stats_after_update\u3068stats_after_delete\u3068\u3044\u30462\u3064\u306e\u65b0\u3057\u3044\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u30c8\u30ea\u30ac\u30fc\u306f\u3001collectibles\u30c6\u30fc\u30d6\u30eb\u3067UPDATE\u307e\u305f\u306fDELETE\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5ea6\u306b\u3001collectible_stats\u30c6\u30fc\u30d6\u30eb\u4e0a\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3089\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u6210\u529f\u3057\u305f\u4f5c\u6210\u306b\u3088\u308a\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u306e\u4fa1\u683c\u3092\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">UPDATE collectibles SET value <span class=\"token operator\">=<\/span> <span class=\"token number\">25.00<\/span> WHERE name <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8216;AIRCRAFT MODEL&#8217;<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>WHERE\u53e5\u306f\u540d\u524d\u306b\u3088\u3063\u3066\u66f4\u65b0\u5bfe\u8c61\u306e\u884c\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u3001SET\u53e5\u306f\u5024\u309225.00\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u51fa\u529b\u306f\u3001\u305d\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c1\u884c\u3060\u3051\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.002 sec) Rows matched: 1 Changed: 1 Warnings: 0<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u5f8c\u306b\u306f\u3001\u6539\u3081\u3066\u8981\u7d04\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_stats<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u306e\u5024\u306f40.00\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u3053\u308c\u304c\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u5f8c\u306e\u6b63\u3057\u3044\u5024\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;-+&#8212;&#8212;-+ | count | value | +&#8212;&#8212;-+&#8212;&#8212;-+ | 2 | 40.00 | +&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u8981\u7d04\u30c6\u30fc\u30d6\u30eb\u304c\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u524a\u9664\u3092\u6b63\u3057\u304f\u53cd\u6620\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6b21\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u822a\u7a7a\u6a5f\u306e\u30e2\u30c7\u30eb\u3092\u524a\u9664\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">DELETE FROM collectibles WHERE name <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8216;AIRCRAFT MODEL&#8217;<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u51fa\u529b\u306f\u3001\u30af\u30a8\u30ea\u304c\u6b63\u5e38\u306b\u5b9f\u884c\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.004 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u5168\u3066\u306e\u30b3\u30ec\u30af\u30bf\u30fc\u30a2\u30a4\u30c6\u30e0\u3092\u30ea\u30b9\u30c8\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | SPACESHIP MODEL | 15.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001\u5b87\u5b99\u8239\u306e\u6a21\u578b\u306e\u307f\u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u6b21\u306b\u3001\u8981\u7d04\u30c6\u30fc\u30d6\u30eb\u306e\u5024\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles_stats<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;-+&#8212;&#8212;-+ | count | value | +&#8212;&#8212;-+&#8212;&#8212;-+ | 1 | 15.00 | +&#8212;&#8212;-+&#8212;&#8212;-+ 1 row in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001\u30ab\u30a6\u30f3\u30c8\u306e\u5217\u306b\u306f\u30e1\u30a4\u30f3\u30c6\u30fc\u30d6\u30eb\u306b\u3042\u308b\u30b3\u30ec\u30af\u30bf\u30d6\u30eb\u304c1\u3064\u3060\u3051\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u5408\u8a08\u306e\u4fa1\u5024\u306f15.00\u3067\u3001SPACESHIP MODEL\u306e\u4fa1\u5024\u3068\u4e00\u81f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>INSERT\u3001UPDATE\u3001DELETE\u30af\u30a8\u30ea\u306e\u5f8c\u3001\u3053\u308c\u3089\u306e3\u3064\u306e\u30c8\u30ea\u30ac\u30fc\u306f\u5354\u8abf\u3057\u3066\u52d5\u4f5c\u3057\u3001\u6982\u8981\u30c6\u30fc\u30d6\u30eb\u3068\u5168\u3066\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30ea\u30b9\u30c8\u3092\u540c\u671f\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e0a\u306e\u65e2\u5b58\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u3073\u307e\u3059\u3002<\/p>\n<h2>\u30c8\u30ea\u30ac\u30fc\u306e\u4e00\u89a7\u8868\u793a\u3068\u524a\u9664<\/h2>\n<p>\u524d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u65b0\u3057\u3044\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u30c8\u30ea\u30ac\u30fc\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e0a\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u540d\u524d\u4ed8\u304d\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308a\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u540c\u69d8\u306b\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u308a\u64cd\u4f5c\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u306b\u306f\u3001SHOW TRIGGERS \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SHOW TRIGGERS<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u306b\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u304c\u542b\u307e\u308c\u307e\u3059\u3002\u305d\u308c\u306b\u306f\u3001\u30c8\u30ea\u30ac\u30fc\u306e\u540d\u524d\u3001\u767a\u751f\u30a4\u30d9\u30f3\u30c8\u3068\u305d\u306e\u5b9f\u884c\u524d\u307e\u305f\u306f\u5b9f\u884c\u5f8c\u306e\u6642\u9593\u3001\u305d\u3057\u3066\u30c8\u30ea\u30ac\u30fc\u672c\u4f53\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3084\u305d\u306e\u4ed6\u306e\u8a73\u7d30\u306a\u5b9a\u7fa9\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output, simplified for readability\">Output, simplified for readability<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;(&#8230;)+&#8212;&#8212;&#8211;+(&#8230;) | Trigger | Event | Table | Statement | Timing |(&#8230;) +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;(&#8230;)+&#8212;&#8212;&#8211;+(&#8230;) | uppercase_before_insert | INSERT | collectibles | SET (&#8230;)| BEFORE |(&#8230;) | stats_after_insert | INSERT | collectibles | UPDATE (&#8230;)| AFTER |(&#8230;) | uppercase_before_update | UPDATE | collectibles | SET (&#8230;)| BEFORE |(&#8230;) | stats_after_update | UPDATE | collectibles | UPDATE (&#8230;)| AFTER |(&#8230;) | archive_before_delete | DELETE | collectibles | INSERT (&#8230;)| BEFORE |(&#8230;) | stats_after_delete | DELETE | collectibles | UPDATE (&#8230;)| AFTER |(&#8230;) +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8211;(&#8230;)+&#8212;&#8212;&#8211;+(&#8230;) 6 rows in set (0.001 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u65e2\u5b58\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u524a\u9664\u3059\u308b\u306b\u306f\u3001DROP TRIGGERSQL\u6587\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u304a\u305d\u3089\u304f\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u540d\u306b\u5927\u6587\u5b57\u3092\u5f37\u5236\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u3063\u305f\u305f\u3081\u3001uppercase_before_insert\u3068uppercase_before_update\u306f\u3082\u3046\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u3053\u308c\u3089\u306e2\u3064\u306e\u30c8\u30ea\u30ac\u30fc\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">DROP TRIGGER uppercase_before_insert<span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"mysql&gt;\">DROP TRIGGER uppercase_before_update<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e21\u65b9\u306e\u30b3\u30de\u30f3\u30c9\u306b\u5bfe\u3057\u3001MySQL\u306f\u6210\u529f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 0 rows affected (0.004 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u30012\u3064\u306e\u30c8\u30ea\u30ac\u30fc\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u3067\u3001\u5c0f\u6587\u5b57\u306e\u65b0\u3057\u3044\u53ce\u96c6\u54c1\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">INSERT INTO collectibles VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8216;<mark>ship model<\/mark>&#8216;<\/span>, <span class=\"token number\">10.00<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3088\u3063\u3066\u633f\u5165\u304c\u78ba\u8a8d\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Query OK, 1 row affected (0.009 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>SELECT\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u884c\u304c\u633f\u5165\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"mysql&gt;\">SELECT * FROM collectibles<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u51fa\u529b\u306f\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | name | value | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ | SPACESHIP MODEL | 15.00 | | <mark>ship model<\/mark> | 10.00 | +&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;-+ 2 rows in set (0.000 sec)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u65b0\u305f\u306b\u8ffd\u52a0\u3055\u308c\u305f\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306f\u5c0f\u6587\u5b57\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u5143\u306e\u51fa\u529b\u3068\u540c\u3058\u540d\u524d\u3067\u3042\u308b\u3053\u3068\u304b\u3089\u3001\u4ee5\u524d\u306e\u6587\u5b57\u306e\u5927\u6587\u5b57\u5909\u63db\u306e\u30c8\u30ea\u30ac\u30fc\u304c\u4f7f\u7528\u3055\u308c\u306a\u304f\u306a\u3063\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u540d\u524d\u3092\u4f7f\u3063\u3066\u30c8\u30ea\u30ac\u30fc\u3092\u4e00\u89a7\u8868\u793a\u3057\u3066\u524a\u9664\u3059\u308b\u65b9\u6cd5\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u30ac\u30a4\u30c9\u306b\u5f93\u3046\u3053\u3068\u3067\u3001SQL\u30c8\u30ea\u30ac\u30fc\u3068\u306f\u4f55\u304b\u3001\u305d\u3057\u3066MySQL\u3067\u30c7\u30fc\u30bf\u3092INSERT\u3068UPDATE\u306e\u30af\u30a8\u30ea\u30fc\u306e\u524d\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u3069\u306e\u3088\u3046\u306b\u4f7f\u7528\u3059\u308b\u304b\u3092\u5b66\u3073\u307e\u3057\u305f\u3002\u524a\u9664\u3055\u308c\u305f\u884c\u3092\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30a2\u30fc\u30ab\u30a4\u30d6\u3059\u308b\u305f\u3081\u306bBEFORE DELETE\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3001\u307e\u305f\u306fAFTER\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u30c8\u30ea\u30ac\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30de\u30ea\u30fc\u3092\u5e38\u306b\u6700\u65b0\u306e\u72b6\u614b\u306b\u4fdd\u3064\u65b9\u6cd5\u3082\u5b66\u3073\u307e\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u64cd\u4f5c\u3084\u691c\u8a3c\u306e\u4e00\u90e8\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30f3\u30b8\u30f3\u306b\u30aa\u30d5\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u3001\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u304c\u4fdd\u305f\u308c\u3001\u307e\u305f\u3001\u30c7\u30a4\u30ea\u30fc\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4e00\u90e8\u306e\u632f\u308b\u821e\u3044\u3092\u96a0\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u305d\u306e\u76ee\u7684\u3067\u30c8\u30ea\u30ac\u30fc\u306e\u57fa\u672c\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u306e\u307f\u3092\u30ab\u30d0\u30fc\u3057\u307e\u3057\u305f\u3002\u8907\u6570\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u69cb\u6210\u3055\u308c\u308b\u8907\u96d1\u306a\u30c8\u30ea\u30ac\u30fc\u3092\u4f5c\u6210\u3057\u3001\u3055\u3089\u306b\u7d30\u304b\u3044\u6761\u4ef6\u30ed\u30b8\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u305d\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306b\u95a2\u3059\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>SQL\u8a00\u8a9e\u3084\u305d\u308c\u306b\u95a2\u308f\u308b\u6982\u5ff5\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u5b66\u3073\u305f\u3044\u65b9\u306f\u3001\u305c\u3072\u300cSQL\u306e\u4f7f\u3044\u65b9\u30b7\u30ea\u30fc\u30ba\u300d\u306e\u4ed6\u306e\u30ac\u30a4\u30c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8457\u8005\u306f\u3001Write for DOnations\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001\u5bc4\u4ed8\u3092\u53d7\u3051\u308b\u305f\u3081\u306bDiversity in Tech Fund\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002 \u5c0e\u5165 \u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068Structured Query L [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,14],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-16","tag-14"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\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.silicloud.com\/ja\/blog\/mysql\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\" \/>\n<meta property=\"og:description\" content=\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/mysql\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-09T04:05:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T04:43:29+00:00\" \/>\n<meta name=\"author\" content=\"\u685c, \u6625\u6a39\" \/>\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=\"\u685c, \u6625\u6a39\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"51\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/\",\"name\":\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-06-09T04:05:26+00:00\",\"dateModified\":\"2025-07-31T04:43:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341\"},\"description\":\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341\",\"name\":\"\u685c, \u6625\u6a39\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"caption\":\"\u685c, \u6625\u6a39\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002 - Blog - Silicon Cloud","description":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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.silicloud.com\/ja\/blog\/mysql\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\/","og_locale":"ja_JP","og_type":"article","og_title":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002","og_description":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/mysql\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-09T04:05:26+00:00","article_modified_time":"2025-07-31T04:43:29+00:00","author":"\u685c, \u6625\u6a39","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u685c, \u6625\u6a39","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"51\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/","name":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-06-09T04:05:26+00:00","dateModified":"2025-07-31T04:43:29+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341"},"description":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"MySQL\u306e\u30c8\u30ea\u30ac\u30fc\u306e\u4f7f\u3044\u65b9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341","name":"\u685c, \u6625\u6a39","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","caption":"\u685c, \u6625\u6a39"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/mysql%e3%81%ae%e3%83%88%e3%83%aa%e3%82%ac%e3%83%bc%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%af%e6%ac%a1%e3%81%ae%e9%80%9a%e3%82%8a%e3%81%a7%e3%81%99%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":35892,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/58\/revisions\/35892"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}