{"id":1520,"date":"2025-02-10T23:37:59","date_gmt":"2025-02-10T15:37:59","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=1520"},"modified":"2025-02-10T23:38:00","modified_gmt":"2025-02-10T15:38:00","slug":"sql%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%98%e6%95%99%e7%a8%8b%ef%bc%9a%e6%9e%84%e5%bb%ba%e9%ab%98%e6%95%88%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e7%b3%bb%e7%bb%9f%e4%b8%8e%e5%8d%9a%e5%ae%a2%e5%ba%94","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/02\/10\/sql%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%98%e6%95%99%e7%a8%8b%ef%bc%9a%e6%9e%84%e5%bb%ba%e9%ab%98%e6%95%88%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e7%b3%bb%e7%bb%9f%e4%b8%8e%e5%8d%9a%e5%ae%a2%e5%ba%94\/","title":{"rendered":"SQL\u9879\u76ee\u5b9e\u6218\u6559\u7a0b\uff1a\u6784\u5efa\u9ad8\u6548\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u4e0e\u535a\u5ba2\u5e94\u7528"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u662f<strong>SQL\u9879\u76ee\u5b9e\u6218\u6559\u7a0b\uff1a\u6784\u5efa\u9ad8\u6548\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u4e0e\u535a\u5ba2\u5e94\u7528<\/strong>\u90e8\u5206\u7684\u8be6\u7ec6\u6559\u7a0b\uff0c\u91cd\u70b9\u8bb2\u89e3\u5982\u4f55\u57fa\u4e8eSQL\u8fdb\u884c\u6570\u636e\u5e93\u8bbe\u8ba1\u3001\u67e5\u8be2\u4f18\u5316\uff0c\u4ee5\u53ca\u5982\u4f55\u5728Flask\u5e94\u7528\u4e2d\u6574\u5408\u6570\u636e\u5e93\u6765\u5f00\u53d1\u4e00\u4e2a\u535a\u5ba2\u7cfb\u7edf\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. SQL \u9879\u76ee\u5b9e\u6218\uff1a\u521b\u5efa\u4e0e\u7ba1\u7406\u4e00\u4e2a\u7b80\u5355\u7684\u535a\u5ba2\u7cfb\u7edf\u6570\u636e\u5e93<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u521b\u5efa\u548c\u7ba1\u7406\u6570\u636e\u5e93\u662f\u5f00\u53d1\u8fc7\u7a0b\u7684\u6838\u5fc3\u90e8\u5206\u3002\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a\u535a\u5ba2\u7cfb\u7edf\u7684\u6570\u636e\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u5982\u4f55\u8fdb\u884c\u6570\u636e\u6a21\u578b\u8bbe\u8ba1\u3001\u4f18\u5316\u548c\u67e5\u8be2\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1.1 \u6570\u636e\u5e93\u6a21\u578b\u8bbe\u8ba1<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u8bbe\u8ba1\u535a\u5ba2\u7cfb\u7edf\u7684\u6570\u636e\u5e93\u6a21\u578b\u3002\u5178\u578b\u7684\u535a\u5ba2\u7cfb\u7edf\u5305\u542b\u7528\u6237\u3001\u6587\u7ae0\u3001\u8bc4\u8bba\u7b49\u5b9e\u4f53\u3002\u6211\u4eec\u9700\u8981\u4e3a\u8fd9\u4e9b\u5b9e\u4f53\u8bbe\u8ba1\u76f8\u5e94\u7684\u6570\u636e\u5e93\u8868\uff0c\u5e76\u786e\u5b9a\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7528\u6237\u8868\uff08users\uff09<\/strong>\uff1a\u5b58\u50a8\u7528\u6237\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u6587\u7ae0\u8868\uff08posts\uff09<\/strong>\uff1a\u5b58\u50a8\u535a\u5ba2\u6587\u7ae0\u4fe1\u606f\u3002<\/li>\n\n\n\n<li><strong>\u8bc4\u8bba\u8868\uff08comments\uff09<\/strong>\uff1a\u5b58\u50a8\u6587\u7ae0\u7684\u8bc4\u8bba\u4fe1\u606f\u3002<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">\u521b\u5efa\u6570\u636e\u5e93\u548c\u8868\u7ed3\u6784<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>-- \u521b\u5efa\u7528\u6237\u8868\nCREATE TABLE users (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    username VARCHAR(100) NOT NULL,\n    email VARCHAR(100) NOT NULL,\n    password VARCHAR(100) NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n\n-- \u521b\u5efa\u6587\u7ae0\u8868\nCREATE TABLE posts (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    title VARCHAR(255) NOT NULL,\n    content TEXT NOT NULL,\n    user_id INT,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    FOREIGN KEY (user_id) REFERENCES users(id)\n);\n\n-- \u521b\u5efa\u8bc4\u8bba\u8868\nCREATE TABLE comments (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    content TEXT NOT NULL,\n    post_id INT,\n    user_id INT,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    FOREIGN KEY (post_id) REFERENCES posts(id),\n    FOREIGN KEY (user_id) REFERENCES users(id)\n);<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">1.2 \u6570\u636e\u6a21\u578b\u7684\u5173\u7cfb\u8bbe\u8ba1<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7528\u6237\u4e0e\u6587\u7ae0<\/strong>\uff1a\u4e00\u5bf9\u591a\u5173\u7cfb\uff0c\u4e00\u4e2a\u7528\u6237\u53ef\u4ee5\u5199\u591a\u7bc7\u6587\u7ae0\uff0c\u4f46\u6bcf\u7bc7\u6587\u7ae0\u53ea\u5c5e\u4e8e\u4e00\u4e2a\u7528\u6237\u3002<\/li>\n\n\n\n<li><strong>\u6587\u7ae0\u4e0e\u8bc4\u8bba<\/strong>\uff1a\u4e00\u5bf9\u591a\u5173\u7cfb\uff0c\u4e00\u7bc7\u6587\u7ae0\u53ef\u4ee5\u6709\u591a\u4e2a\u8bc4\u8bba\uff0c\u4f46\u6bcf\u4e2a\u8bc4\u8bba\u53ea\u5c5e\u4e8e\u4e00\u7bc7\u6587\u7ae0\u3002<\/li>\n\n\n\n<li><strong>\u7528\u6237\u4e0e\u8bc4\u8bba<\/strong>\uff1a\u4e00\u5bf9\u591a\u5173\u7cfb\uff0c\u4e00\u4e2a\u7528\u6237\u53ef\u4ee5\u8bc4\u8bba\u591a\u7bc7\u6587\u7ae0\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4f7f\u7528\u5916\u952e\u7ea6\u675f\uff08<code>FOREIGN KEY<\/code>\uff09\u6765\u7ef4\u62a4\u6570\u636e\u4e00\u81f4\u6027\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. \u57fa\u4e8e SQL \u5b8c\u6210\u6570\u636e\u5e93\u6a21\u578b\u8bbe\u8ba1\u3001\u67e5\u8be2\u4e0e\u4f18\u5316<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6570\u636e\u5e93\u6a21\u578b\u8bbe\u8ba1\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u4e00\u4e9b\u5e38\u89c1\u7684\u6570\u636e\u5e93\u67e5\u8be2\u64cd\u4f5c\u3002\u5bf9\u4e8e\u535a\u5ba2\u5e94\u7528\uff0c\u5e38\u89c1\u7684\u64cd\u4f5c\u5305\u62ec\u6587\u7ae0\u67e5\u8be2\u3001\u8bc4\u8bba\u67e5\u8be2\u4ee5\u53ca\u7528\u6237\u4fe1\u606f\u67e5\u8be2\u7b49\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.1 \u67e5\u8be2\u64cd\u4f5c<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u67e5\u8be2\u6240\u6709\u6587\u7ae0\u53ca\u5176\u4f5c\u8005\u4fe1\u606f\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT p.title, p.content, u.username \n  FROM posts p\n  JOIN users u ON p.user_id = u.id;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u67e5\u8be2\u67d0\u7bc7\u6587\u7ae0\u7684\u6240\u6709\u8bc4\u8bba\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT c.content, u.username \n  FROM comments c\n  JOIN users u ON c.user_id = u.id\n  WHERE c.post_id = 1;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u67e5\u8be2\u67d0\u7528\u6237\u7684\u6240\u6709\u6587\u7ae0\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  SELECT title, content \n  FROM posts\n  WHERE user_id = 1;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2.2 \u6570\u636e\u4f18\u5316\u4e0e\u7d22\u5f15<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u63d0\u9ad8\u67e5\u8be2\u6027\u80fd\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5927\u578b\u6570\u636e\u5e93\uff0c\u521b\u5efa\u7d22\u5f15\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4e3a <code>user_id<\/code> \u548c <code>post_id<\/code> \u5217\u521b\u5efa\u7d22\u5f15\uff0c\u4ee5\u52a0\u901f\u67e5\u8be2\u901f\u5ea6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE INDEX idx_user_id ON posts(user_id);\nCREATE INDEX idx_post_id ON comments(post_id);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u7d22\u5f15\u4f1a\u4f7f\u5f97\u6570\u636e\u5e93\u5728\u8fdb\u884c <code>JOIN<\/code> \u64cd\u4f5c\u6216\u67e5\u8be2\u65f6\uff0c\u80fd\u591f\u66f4\u52a0\u9ad8\u6548\u5730\u67e5\u627e\u76f8\u5173\u6570\u636e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. \u5728 Flask \u4e2d\u6574\u5408 SQL \u6570\u636e\u5e93\u8fdb\u884c\u5f00\u53d1<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Flask \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684 Web \u6846\u67b6\uff0c\u80fd\u591f\u5feb\u901f\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002\u6211\u4eec\u53ef\u4ee5\u5c06 SQL \u6570\u636e\u5e93\u4e0e Flask \u96c6\u6210\uff0c\u6765\u5f00\u53d1\u4e00\u4e2a\u529f\u80fd\u5b8c\u5584\u7684\u535a\u5ba2\u7cfb\u7edf\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3.1 \u8bbe\u7f6e Flask \u4e0e SQLAlchemy<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Flask \u9879\u76ee\u4e2d\u4f7f\u7528 SQLAlchemy \u4f5c\u4e3a ORM\uff08\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff09\u5de5\u5177\uff0c\u5b83\u80fd\u5e2e\u52a9\u6211\u4eec\u66f4\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u88c5 Flask \u548c Flask-SQLAlchemy\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  pip install Flask Flask-SQLAlchemy<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u914d\u7f6e Flask \u4e0e\u6570\u636e\u5e93\u8fde\u63a5\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\napp.config&#91;'SQLALCHEMY_DATABASE_URI'] = 'mysql:\/\/username:password@localhost\/blog_db'\napp.config&#91;'SQLALCHEMY_TRACK_MODIFICATIONS'] = False\ndb = SQLAlchemy(app)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.2 \u5b9a\u4e49\u6570\u636e\u6a21\u578b<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7 SQLAlchemy \u5b9a\u4e49\u6570\u636e\u5e93\u8868\u4e0e\u5173\u7cfb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class User(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    username = db.Column(db.String(100), nullable=False)\n    email = db.Column(db.String(100), nullable=False)\n    password = db.Column(db.String(100), nullable=False)\n    posts = db.relationship('Post', backref='author', lazy=True)\n\nclass Post(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    title = db.Column(db.String(255), nullable=False)\n    content = db.Column(db.Text, nullable=False)\n    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)\n    comments = db.relationship('Comment', backref='post', lazy=True)\n\nclass Comment(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    content = db.Column(db.Text, nullable=False)\n    post_id = db.Column(db.Integer, db.ForeignKey('post.id'), nullable=False)\n    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3.3 \u521b\u5efa\u6570\u636e\u5e93<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Flask \u4e2d\u521b\u5efa\u6570\u636e\u5e93\u548c\u8868\u7ed3\u6784\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>with app.app_context():\n    db.create_all()<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. \u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5f00\u53d1\u548c\u4f7f\u7528SQL\u6570\u636e\u5e93\u65f6\uff0c\u5e38\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\u53ca\u5176\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.1 \u9047\u5230\u5e38\u89c1 SQL \u9519\u8bef\u65f6\u5982\u4f55\u8c03\u8bd5\u4e0e\u4fee\u590d<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SQL \u9519\u8bef<\/strong>\uff1a\u4f8b\u5982\uff0c\u8bed\u6cd5\u9519\u8bef\u6216\u5b57\u6bb5\u7c7b\u578b\u9519\u8bef\u3002<\/li>\n\n\n\n<li><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u68c0\u67e5SQL\u8bed\u53e5\u7684\u8bed\u6cd5\uff0c\u786e\u4fdd\u6240\u6709\u8868\u548c\u5b57\u6bb5\u540d\u6b63\u786e\u65e0\u8bef\u3002\u53ef\u4ee5\u901a\u8fc7 <code>EXPLAIN<\/code> \u6765\u68c0\u67e5\u67e5\u8be2\u6267\u884c\u8ba1\u5212\uff0c\u5e2e\u52a9\u5b9a\u4f4d\u95ee\u9898\u3002<\/li>\n\n\n\n<li><strong>\u6570\u636e\u4e00\u81f4\u6027\u9519\u8bef<\/strong>\uff1a\u4f8b\u5982\uff0c\u5916\u952e\u7ea6\u675f\u9519\u8bef\u6216\u91cd\u590d\u6570\u636e\u3002<\/li>\n\n\n\n<li><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u786e\u4fdd\u5916\u952e\u7ea6\u675f\u4e00\u81f4\uff0c\u907f\u514d\u63d2\u5165\u91cd\u590d\u7684\u6570\u636e\u3002\u4f7f\u7528\u4e8b\u52a1\u5904\u7406\uff08<code>BEGIN<\/code>, <code>COMMIT<\/code>, <code>ROLLBACK<\/code>\uff09\u6765\u786e\u4fdd\u6570\u636e\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4.2 \u5982\u4f55\u5904\u7406\u6570\u636e\u4e00\u81f4\u6027\u4e0e\u4e8b\u52a1\u95ee\u9898<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8b\u52a1\u662f\u4fdd\u8bc1\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u539f\u5b50\u6027\u548c\u4e00\u81f4\u6027\u7684\u5173\u952e\u3002\u4f7f\u7528\u4e8b\u52a1\u53ef\u4ee5\u786e\u4fdd\u591a\u6761SQL\u64cd\u4f5c\u8981\u4e48\u5168\u90e8\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u5931\u8d25\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f00\u59cb\u4e8b\u52a1\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  BEGIN;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u63d0\u4ea4\u4e8b\u52a1\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  COMMIT;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u56de\u6eda\u4e8b\u52a1\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  ROLLBACK;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4e8b\u52a1\u5904\u7406\uff0c\u786e\u4fdd\u5728\u6267\u884c\u590d\u6742\u64cd\u4f5c\u65f6\uff0c\u6570\u636e\u80fd\u591f\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u907f\u514d\u534a\u5b8c\u6210\u7684\u64cd\u4f5c\u5bfc\u81f4\u6570\u636e\u9519\u8bef\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u672c\u6559\u7a0b\uff0c\u4f60\u5df2\u638c\u63e1\u4e86\u5982\u4f55\u6784\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u535a\u5ba2\u5e94\u7528\u6570\u636e\u5e93\uff0c\u5e76\u5728 Flask \u4e2d\u4e0eSQL\u6570\u636e\u5e93\u8fdb\u884c\u96c6\u6210\u3002\u4f60\u8fd8\u5b66\u4f1a\u4e86\u5982\u4f55\u8bbe\u8ba1\u6570\u636e\u5e93\u6a21\u578b\u3001\u8fdb\u884c\u9ad8\u6548\u67e5\u8be2\u3001\u4f18\u5316\u6027\u80fd\uff0c\u5e76\u5904\u7406\u5e38\u89c1\u7684SQL\u95ee\u9898\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u638c\u63e1\u8fd9\u4e9b\u6280\u80fd\u540e\uff0c\u4f60\u53ef\u4ee5\u7ee7\u7eed\u6269\u5c55\u535a\u5ba2\u5e94\u7528\u7684\u529f\u80fd\uff0c\u6dfb\u52a0\u66f4\u591a\u7684\u7279\u6027\uff0c\u5982\u7528\u6237\u8ba4\u8bc1\u3001\u6587\u7ae0\u5206\u7c7b\u3001\u6807\u7b7e\u3001\u6587\u4ef6\u4e0a\u4f20\u7b49\u3002SQL\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u7684\u5e94\u7528\u975e\u5e38\u5e7f\u6cdb\uff0c\u719f\u7ec3\u638c\u63e1\u5b83\u5c06\u5e2e\u52a9\u4f60\u5f00\u53d1\u66f4\u52a0\u590d\u6742\u548c\u9ad8\u6548\u7684\u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u662fSQL\u9879\u76ee\u5b9e\u6218\u6559\u7a0b\uff1a\u6784\u5efa\u9ad8\u6548\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u4e0e\u535a\u5ba2\u5e94\u7528\u90e8\u5206\u7684\u8be6\u7ec6\u6559\u7a0b\uff0c\u91cd\u70b9\u8bb2\u89e3\u5982\u4f55\u57fa\u4e8eSQL\u8fdb\u884c\u6570\u636e\u5e93\u8bbe\u8ba1\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-1520","post","type-post","status-publish","format-standard","hentry","category-sql"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1520","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=1520"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1520\/revisions"}],"predecessor-version":[{"id":1521,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1520\/revisions\/1521"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=1520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=1520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=1520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}