{"id":1792,"date":"2025-02-18T22:53:34","date_gmt":"2025-02-18T14:53:34","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=1792"},"modified":"2025-02-18T22:53:34","modified_gmt":"2025-02-18T14:53:34","slug":"mysql-%e7%b4%a2%e5%bc%95","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/02\/18\/mysql-%e7%b4%a2%e5%bc%95\/","title":{"rendered":"MySQL \u7d22\u5f15"},"content":{"rendered":"\n<p>MySQL \u7d22\u5f15\u662f\u7528\u4e8e\u52a0\u901f\u67e5\u8be2\u64cd\u4f5c\u7684\u6570\u636e\u5e93\u5bf9\u8c61\uff0c\u7c7b\u4f3c\u4e8e\u4e66\u7c4d\u7684\u76ee\u5f55\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6570\u636e\u5e93\u66f4\u5feb\u901f\u5730\u67e5\u627e\u6570\u636e\u3002\u7d22\u5f15\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u67e5\u8be2\u7684\u901f\u5ea6\uff0c\u5c24\u5176\u662f\u5728\u6d89\u53ca\u5927\u91cf\u6570\u636e\u65f6\u3002\u7406\u89e3 MySQL \u7d22\u5f15\u7684\u5de5\u4f5c\u539f\u7406\u3001\u4f7f\u7528\u65b9\u6cd5\u548c\u4f18\u5316\u6280\u5de7\uff0c\u662f\u6210\u4e3a MySQL \u9ad8\u6548\u5f00\u53d1\u8005\u7684\u91cd\u8981\u4e00\u6b65\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>\u7d22\u5f15\u7684\u57fa\u672c\u6982\u5ff5<\/strong><\/h3>\n\n\n\n<p>\u7d22\u5f15\u662f\u6570\u636e\u5e93\u4e2d\u7528\u4e8e\u52a0\u901f\u67e5\u8be2\u7684\u5bf9\u8c61\uff0c\u7c7b\u4f3c\u4e8e\u4e66\u7c4d\u7684\u76ee\u5f55\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u63d0\u9ad8\u6570\u636e\u68c0\u7d22\u7684\u901f\u5ea6\u3002\u7d22\u5f15\u5b9e\u9645\u4e0a\u662f\u5bf9\u6570\u636e\u5e93\u8868\u4e2d\u4e00\u5217\u6216\u591a\u5217\u7684\u503c\u5efa\u7acb\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5b83\u53ef\u4ee5\u51cf\u5c11\u626b\u63cf\u5168\u8868\u6240\u9700\u7684\u65f6\u95f4\u3002<\/p>\n\n\n\n<p>\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u666e\u901a\u7d22\u5f15\uff08Index\uff09<\/strong>\uff1a\u6700\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u5141\u8bb8\u5b57\u6bb5\u4e2d\u6709\u91cd\u590d\u503c\u3002<\/li>\n\n\n\n<li><strong>\u552f\u4e00\u7d22\u5f15\uff08UNIQUE Index\uff09<\/strong>\uff1a\u8981\u6c42\u5b57\u6bb5\u503c\u5fc5\u987b\u552f\u4e00\uff0c\u4f46\u53ef\u4ee5\u5305\u542b <code>NULL<\/code> \u503c\u3002<\/li>\n\n\n\n<li><strong>\u4e3b\u952e\u7d22\u5f15\uff08PRIMARY Key\uff09<\/strong>\uff1a\u552f\u4e00\u6027\u7d22\u5f15\u7684\u4e00\u79cd\uff0c\u5e76\u4e14\u4e0d\u80fd\u4e3a\u7a7a\u3002<\/li>\n\n\n\n<li><strong>\u5168\u6587\u7d22\u5f15\uff08FULLTEXT Index\uff09<\/strong>\uff1a\u4e3b\u8981\u7528\u4e8e\u6587\u672c\u6570\u636e\u7684\u641c\u7d22\u3002<\/li>\n\n\n\n<li><strong>\u7ec4\u5408\u7d22\u5f15\uff08Composite Index\uff09<\/strong>\uff1a\u57fa\u4e8e\u591a\u4e2a\u5217\u521b\u5efa\u7684\u7d22\u5f15\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>\u7d22\u5f15\u7684\u4f5c\u7528<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u63d0\u9ad8\u67e5\u8be2\u6548\u7387<\/strong>\uff1a\u901a\u8fc7\u7d22\u5f15\uff0cMySQL \u53ef\u4ee5\u5728\u67e5\u8be2\u65f6\u76f4\u63a5\u5b9a\u4f4d\u5230\u6570\u636e\u7684\u4f4d\u7f6e\uff0c\u51cf\u5c11\u4e86\u5168\u8868\u626b\u63cf\u7684\u5f00\u9500\u3002<\/li>\n\n\n\n<li><strong>\u52a0\u901f\u6392\u5e8f\u548c\u5206\u7ec4<\/strong>\uff1a\u7d22\u5f15\u53ef\u4ee5\u52a0\u901f <code>ORDER BY<\/code> \u548c <code>GROUP BY<\/code> \u64cd\u4f5c\u3002<\/li>\n\n\n\n<li><strong>\u52a0\u901f\u8fde\u63a5\u67e5\u8be2<\/strong>\uff1a\u5728\u591a\u8868\u8fde\u63a5\u65f6\uff0c\u7d22\u5f15\u53ef\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002<\/li>\n\n\n\n<li><strong>\u907f\u514d\u5168\u8868\u626b\u63cf<\/strong>\uff1a\u5c24\u5176\u5728\u5927\u6570\u636e\u91cf\u65f6\uff0c\u7d22\u5f15\u80fd\u591f\u663e\u8457\u51cf\u5c11\u6570\u636e\u7684\u8bfb\u53d6\u91cf\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u7d22\u5f15\u7684\u79cd\u7c7b\u548c\u521b\u5efa<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">3.1 \u666e\u901a\u7d22\u5f15\uff08Index\uff09<\/h4>\n\n\n\n<p>\u666e\u901a\u7d22\u5f15\u662f\u6700\u5e38\u89c1\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u53ef\u4ee5\u52a0\u901f\u67e5\u8be2\uff0c\u4f46\u4e0d\u8981\u6c42\u5217\u7684\u503c\u552f\u4e00\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE INDEX idx_emp_name ON employees (emp_name);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.2 \u552f\u4e00\u7d22\u5f15\uff08UNIQUE Index\uff09<\/h4>\n\n\n\n<p>\u552f\u4e00\u7d22\u5f15\u8981\u6c42\u5b57\u6bb5\u503c\u5fc5\u987b\u552f\u4e00\uff0c\u4f46\u5141\u8bb8 <code>NULL<\/code> \u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE UNIQUE INDEX idx_emp_email ON employees (emp_email);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.3 \u4e3b\u952e\u7d22\u5f15\uff08PRIMARY KEY\uff09<\/h4>\n\n\n\n<p>\u4e3b\u952e\u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u552f\u4e00\u7d22\u5f15\uff0c\u4e0d\u5141\u8bb8\u6709 <code>NULL<\/code> \u503c\u3002\u5728 MySQL \u4e2d\uff0c\u8868\u7684\u4e3b\u952e\u662f\u81ea\u52a8\u521b\u5efa\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE employees (\n    emp_id INT PRIMARY KEY,\n    emp_name VARCHAR(255)\n);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.4 \u5168\u6587\u7d22\u5f15\uff08FULLTEXT Index\uff09<\/h4>\n\n\n\n<p>\u5168\u6587\u7d22\u5f15\u7528\u4e8e\u6587\u672c\u7c7b\u578b\u5b57\u6bb5\uff08\u5982 <code>CHAR<\/code>\u3001<code>VARCHAR<\/code>\u3001<code>TEXT<\/code>\uff09\uff0c\u5b83\u9002\u7528\u4e8e\u6587\u672c\u641c\u7d22\uff0cMySQL \u63d0\u4f9b\u4e86 <code>MATCH<\/code> \u548c <code>AGAINST<\/code> \u6765\u8fdb\u884c\u5168\u6587\u641c\u7d22\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE FULLTEXT INDEX idx_emp_desc ON employees (emp_description);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.5 \u7ec4\u5408\u7d22\u5f15\uff08Composite Index\uff09<\/h4>\n\n\n\n<p>\u7ec4\u5408\u7d22\u5f15\u662f\u5bf9\u591a\u4e2a\u5217\u540c\u65f6\u521b\u5efa\u7684\u7d22\u5f15\u3002\u5728\u67e5\u8be2\u4e2d\uff0c\u5982\u679c\u6d89\u53ca\u591a\u4e2a\u5217\u7684\u6761\u4ef6\uff0c\u7ec4\u5408\u7d22\u5f15\u80fd\u663e\u8457\u63d0\u5347\u6027\u80fd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE INDEX idx_emp_dept_salary ON employees (emp_dept_id, emp_salary);<\/code><\/pre>\n\n\n\n<p>\u5728\u67e5\u8be2\u65f6\uff0c\u5982\u679c\u6d89\u53ca <code>emp_dept_id<\/code> \u548c <code>emp_salary<\/code> \u7684\u7ec4\u5408\u6761\u4ef6\uff0cMySQL \u4f1a\u4f7f\u7528\u8be5\u7ec4\u5408\u7d22\u5f15\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u4f7f\u7528\u7d22\u5f15\u67e5\u8be2<\/strong><\/h3>\n\n\n\n<p>\u7d22\u5f15\u7684\u5b58\u5728\u53ef\u4ee5\u663e\u8457\u52a0\u901f\u67e5\u8be2\u64cd\u4f5c\uff0c\u5c24\u5176\u662f\u5728\u67e5\u8be2\u6761\u4ef6\u4e2d\u6d89\u53ca\u7d22\u5f15\u5217\u65f6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5178\u578b\u7684\u67e5\u8be2\u793a\u4f8b\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.1 \u4f7f\u7528\u666e\u901a\u7d22\u5f15<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM employees WHERE emp_name = 'John';<\/code><\/pre>\n\n\n\n<p>\u5982\u679c <code>emp_name<\/code> \u5217\u4e0a\u6709\u7d22\u5f15\uff0cMySQL \u4f1a\u5229\u7528\u8be5\u7d22\u5f15\u6765\u52a0\u901f\u67e5\u8be2\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.2 \u4f7f\u7528\u552f\u4e00\u7d22\u5f15<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM employees WHERE emp_email = 'john@example.com';<\/code><\/pre>\n\n\n\n<p>\u5982\u679c <code>emp_email<\/code> \u5217\u4e0a\u6709\u552f\u4e00\u7d22\u5f15\uff0cMySQL \u4f1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15\u627e\u5230\u8be5\u8bb0\u5f55\uff0c\u907f\u514d\u4e86\u5168\u8868\u626b\u63cf\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.3 \u4f7f\u7528\u7ec4\u5408\u7d22\u5f15<\/h4>\n\n\n\n<p>\u5047\u8bbe <code>emp_dept_id<\/code> \u548c <code>emp_salary<\/code> \u7ec4\u6210\u4e86\u4e00\u4e2a\u7ec4\u5408\u7d22\u5f15\uff0c\u5982\u679c\u67e5\u8be2\u6761\u4ef6\u6d89\u53ca\u8fd9\u4e24\u4e2a\u5217\uff0cMySQL \u4f1a\u4f7f\u7528\u7ec4\u5408\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM employees WHERE emp_dept_id = 1 AND emp_salary &gt; 50000;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u7d22\u5f15\u7684\u4f18\u5316\u4e0e\u4f7f\u7528<\/strong><\/h3>\n\n\n\n<p>\u867d\u7136\u7d22\u5f15\u53ef\u4ee5\u52a0\u901f\u67e5\u8be2\uff0c\u4f46\u4e0d\u6b63\u786e\u7684\u4f7f\u7528\u4f1a\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5173\u4e8e\u5982\u4f55\u4f18\u5316\u7d22\u5f15\u7684\u6280\u5de7\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.1 \u5c3d\u91cf\u907f\u514d\u8fc7\u591a\u7684\u7d22\u5f15<\/h4>\n\n\n\n<p>\u6bcf\u589e\u52a0\u4e00\u4e2a\u7d22\u5f15\uff0cMySQL \u5728\u6267\u884c\u63d2\u5165\u3001\u66f4\u65b0\u548c\u5220\u9664\u64cd\u4f5c\u65f6\u90fd\u4f1a\u989d\u5916\u6d88\u8017\u65f6\u95f4\uff0c\u56e0\u4e3a\u6bcf\u6b21\u6570\u636e\u53d8\u52a8\u65f6\uff0c\u7d22\u5f15\u4e5f\u9700\u8981\u66f4\u65b0\u3002\u56e0\u6b64\uff0c\u7d22\u5f15\u5e94\u6839\u636e\u5b9e\u9645\u7684\u67e5\u8be2\u9700\u6c42\u6765\u521b\u5efa\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.2 \u4f7f\u7528\u5408\u9002\u7684\u5217\u8fdb\u884c\u7d22\u5f15<\/h4>\n\n\n\n<p>\u901a\u5e38\uff0c\u7d22\u5f15\u5e94\u8be5\u5e94\u7528\u5728\u67e5\u8be2\u9891\u7e41\u4f7f\u7528\u7684\u5217\uff0c\u7279\u522b\u662f\u90a3\u4e9b\u7528\u4e8e <code>WHERE<\/code>\u3001<code>JOIN<\/code>\u3001<code>ORDER BY<\/code> \u548c <code>GROUP BY<\/code> \u7684\u5217\u3002\u4f8b\u5982\uff0c\u82e5\u4e00\u4e2a\u5217\u5728\u67e5\u8be2\u4e2d\u4f5c\u4e3a\u7b5b\u9009\u6761\u4ef6\uff08\u5982 <code>emp_id<\/code>\uff09\uff0c\u5219\u8be5\u5217\u5e94\u8be5\u88ab\u7d22\u5f15\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.3 \u7d22\u5f15\u5217\u7684\u987a\u5e8f\u5f88\u91cd\u8981<\/h4>\n\n\n\n<p>\u5728\u7ec4\u5408\u7d22\u5f15\u4e2d\uff0c\u5217\u7684\u987a\u5e8f\u4f1a\u5f71\u54cd\u7d22\u5f15\u7684\u4f7f\u7528\u3002\u5982\u679c\u67e5\u8be2\u4e2d\u7684\u6761\u4ef6\u6309\u7d22\u5f15\u7684\u987a\u5e8f\u6392\u5217\uff0cMySQL \u4f1a\u66f4\u9ad8\u6548\u5730\u5229\u7528\u7d22\u5f15\u3002\u4f8b\u5982\uff0c<code>(emp_dept_id, emp_salary)<\/code> \u7684\u7d22\u5f15\u4f1a\u5bf9 <code>(emp_dept_id)<\/code> \u7684\u67e5\u8be2\u66f4\u6709\u6548\uff0c\u4f46\u5bf9\u4ec5\u4ec5\u67e5\u8be2 <code>emp_salary<\/code> \u7684\u6761\u4ef6\u6548\u679c\u8f83\u5dee\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5.4 \u4f7f\u7528\u8986\u76d6\u7d22\u5f15<\/h4>\n\n\n\n<p>\u5982\u679c\u67e5\u8be2\u4e2d\u53ea\u6d89\u53ca\u7d22\u5f15\u4e2d\u7684\u5217\uff08\u65e0\u9700\u8bbf\u95ee\u8868\u4e2d\u7684\u5176\u4ed6\u5217\uff09\uff0c\u90a3\u4e48\u8fd9\u79cd\u60c5\u51b5\u53eb\u505a <strong>\u8986\u76d6\u7d22\u5f15<\/strong>\u3002\u8986\u76d6\u7d22\u5f15\u53ef\u4ee5\u907f\u514d\u989d\u5916\u7684\u8868\u6570\u636e\u8bbf\u95ee\uff0c\u63d0\u5347\u67e5\u8be2\u6027\u80fd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT emp_id, emp_name FROM employees WHERE emp_dept_id = 1;<\/code><\/pre>\n\n\n\n<p>\u5982\u679c <code>emp_dept_id<\/code> \u5217\u4e0a\u6709\u7d22\u5f15\uff0c\u5e76\u4e14\u67e5\u8be2\u53ea\u6d89\u53ca\u7d22\u5f15\u5217\uff0cMySQL \u4f1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15\u83b7\u53d6\u7ed3\u679c\uff0c\u800c\u65e0\u9700\u8bbf\u95ee\u8868\u4e2d\u7684\u5176\u4ed6\u6570\u636e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>\u7d22\u5f15\u7684\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">6.1 \u67e5\u770b\u7d22\u5f15<\/h4>\n\n\n\n<p>\u8981\u67e5\u770b\u8868\u4e2d\u6240\u6709\u7684\u7d22\u5f15\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>SHOW INDEX<\/code> \u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHOW INDEX FROM employees;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6.2 \u5220\u9664\u7d22\u5f15<\/h4>\n\n\n\n<p>\u5982\u679c\u67d0\u4e2a\u7d22\u5f15\u4e0d\u518d\u9700\u8981\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>DROP INDEX<\/code> \u5220\u9664\u7d22\u5f15\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP INDEX idx_emp_name ON employees;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6.3 \u4fee\u6539\u7d22\u5f15<\/h4>\n\n\n\n<p>\u5728 MySQL \u4e2d\uff0c\u4e0d\u80fd\u76f4\u63a5\u4fee\u6539\u7d22\u5f15\u3002\u5982\u679c\u9700\u8981\u4fee\u6539\u7d22\u5f15\uff0c\u4f60\u9700\u8981\u5148\u5220\u9664\u65e7\u7684\u7d22\u5f15\uff0c\u518d\u521b\u5efa\u65b0\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP INDEX idx_emp_name ON employees;\nCREATE INDEX idx_emp_full_name ON employees (emp_first_name, emp_last_name);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>\u5e38\u89c1\u7684\u7d22\u5f15\u8bef\u533a<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5168\u8868\u626b\u63cf\u4e0e\u7d22\u5f15\u626b\u63cf<\/strong>\uff1a\u867d\u7136\u7d22\u5f15\u52a0\u901f\u4e86\u67e5\u8be2\uff0c\u4f46\u5982\u679c\u67e5\u8be2\u4e0d\u6d89\u53ca\u7d22\u5f15\u5217\uff0c\u6216\u8005\u67e5\u8be2\u6761\u4ef6\u4e0d\u9002\u5408\u73b0\u6709\u7d22\u5f15\uff0cMySQL \u53ef\u80fd\u4f1a\u9009\u62e9\u5168\u8868\u626b\u63cf\u3002\u7406\u89e3\u67e5\u8be2\u8ba1\u5212\u548c\u4f18\u5316\u7d22\u5f15\u975e\u5e38\u91cd\u8981\u3002<\/li>\n\n\n\n<li><strong>\u7d22\u5f15\u7684\u5f00\u9500<\/strong>\uff1a\u867d\u7136\u7d22\u5f15\u53ef\u4ee5\u52a0\u901f\u67e5\u8be2\uff0c\u4f46\u5b83\u4eec\u4f1a\u589e\u52a0 <code>INSERT<\/code>\u3001<code>UPDATE<\/code> \u548c <code>DELETE<\/code> \u64cd\u4f5c\u7684\u5f00\u9500\uff0c\u56e0\u4e3a\u6bcf\u6b21\u6570\u636e\u4fee\u6539\u65f6\uff0c\u7d22\u5f15\u4e5f\u9700\u8981\u66f4\u65b0\u3002<\/li>\n\n\n\n<li><strong>\u8fc7\u5ea6\u7d22\u5f15<\/strong>\uff1a\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u521b\u5efa\u8fc7\u591a\u7684\u7d22\u5f15\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002\u5e94\u6839\u636e\u5b9e\u9645\u4f7f\u7528\u60c5\u51b5\u5408\u7406\u521b\u5efa\u7d22\u5f15\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">8. <strong>\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7d22\u5f15\u662f\u63d0\u5347 MySQL \u67e5\u8be2\u6027\u80fd\u7684\u5173\u952e\u5de5\u5177\uff0c\u4f46\u4e0d\u6b63\u786e\u7684\u4f7f\u7528\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002<\/li>\n\n\n\n<li>\u7d22\u5f15\u7c7b\u578b\u5305\u62ec\u666e\u901a\u7d22\u5f15\u3001\u552f\u4e00\u7d22\u5f15\u3001\u4e3b\u952e\u7d22\u5f15\u3001\u5168\u6587\u7d22\u5f15\u548c\u7ec4\u5408\u7d22\u5f15\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528\u7d22\u5f15\u65f6\u5e94\u6ce8\u610f\u9009\u62e9\u9002\u5408\u7684\u5217\uff0c\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u7d22\u5f15\uff0c\u5408\u7406\u5b89\u6392\u7d22\u5f15\u5217\u7684\u987a\u5e8f\u3002<\/li>\n\n\n\n<li>\u7d22\u5f15\u4e0d\u4ec5\u52a0\u901f\u67e5\u8be2\uff0c\u4e5f\u589e\u52a0\u4e86 <code>INSERT<\/code>\u3001<code>UPDATE<\/code> \u548c <code>DELETE<\/code> \u7684\u5f00\u9500\uff0c\u9700\u8981\u5728\u5b9e\u9645\u9700\u6c42\u4e2d\u5e73\u8861\u6027\u80fd\u3002<\/li>\n\n\n\n<li>\u901a\u8fc7\u5408\u7406\u5730\u521b\u5efa\u548c\u7ba1\u7406\u7d22\u5f15\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u5347 MySQL \u6570\u636e\u5e93\u7684\u67e5\u8be2\u6027\u80fd\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>MySQL \u7d22\u5f15\u662f\u7528\u4e8e\u52a0\u901f\u67e5\u8be2\u64cd\u4f5c\u7684\u6570\u636e\u5e93\u5bf9\u8c61\uff0c\u7c7b\u4f3c\u4e8e\u4e66\u7c4d\u7684\u76ee\u5f55\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6570\u636e\u5e93\u66f4\u5feb\u901f\u5730\u67e5\u627e\u6570\u636e\u3002\u7d22\u5f15\u672c\u8d28\u4e0a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-1792","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=1792"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1792\/revisions"}],"predecessor-version":[{"id":1793,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1792\/revisions\/1793"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=1792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=1792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=1792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}