{"id":168593,"date":"2024-11-06T13:58:57","date_gmt":"2024-11-06T05:58:57","guid":{"rendered":"https:\/\/server.hk\/cnblog\/168593\/"},"modified":"2024-11-06T13:58:58","modified_gmt":"2024-11-06T05:58:58","slug":"stackoverflow-%e7%99%bc%e5%b8%83-2017-%e5%b9%b4%e6%9c%80%e6%b5%81%e8%a1%8c%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%92%e5%90%8d","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/168593\/","title":{"rendered":"StackOverflow \u767c\u5e03 2017 \u5e74\u6700\u6d41\u884c\u6578\u64da\u5eab\u6392\u540d"},"content":{"rendered":"<h1 id=\"stackoverflow-%e7%99%bc%e5%b8%83-2017-%e5%b9%b4%e6%9c%80%e6%b5%81%e8%a1%8c%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%92%e5%90%8d-tVQvMfPlfz\">StackOverflow \u767c\u5e03 2017 \u5e74\u6700\u6d41\u884c\u6578\u64da\u5eab\u6392\u540d<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6280\u8853\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u9078\u64c7\u5c0d\u65bc\u958b\u767c\u8005\u548c\u4f01\u696d\u4f86\u8aaa\u81f3\u95dc\u91cd\u8981\u3002\u6839\u64da StackOverflow \u5728 2017 \u5e74\u7684\u8abf\u67e5\uff0c\u6578\u64da\u5eab\u7684\u4f7f\u7528\u60c5\u6cc1\u986f\u793a\u51fa\u4e86\u4e00\u4e9b\u6709\u8da3\u7684\u8da8\u52e2\u548c\u504f\u597d\u3002\u9019\u7bc7\u6587\u7ae0\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e9b\u6578\u64da\uff0c\u4e26\u5206\u6790\u70ba\u4f55\u67d0\u4e9b\u6578\u64da\u5eab\u5728\u958b\u767c\u8005\u793e\u7fa4\u4e2d\u5982\u6b64\u53d7\u6b61\u8fce\u3002<\/p>\n<h2 id=\"2017-%e5%b9%b4%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%92%e5%90%8d%e6%a6%82%e8%a6%bd-tVQvMfPlfz\">2017 \u5e74\u6578\u64da\u5eab\u6392\u540d\u6982\u89bd<\/h2>\n<p>\u6839\u64da StackOverflow \u7684\u8abf\u67e5\uff0c2017 \u5e74\u6700\u53d7\u6b61\u8fce\u7684\u6578\u64da\u5eab\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>MySQL<\/li>\n<li>PostgreSQL<\/li>\n<li>SQLite<\/li>\n<li>MongoDB<\/li>\n<li>Microsoft SQL Server<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u6578\u64da\u5eab\u7684\u53d7\u6b61\u8fce\u7a0b\u5ea6\u4e0d\u50c5\u53cd\u6620\u4e86\u5b83\u5011\u7684\u529f\u80fd\u548c\u6027\u80fd\uff0c\u9084\u986f\u793a\u4e86\u958b\u767c\u8005\u5c0d\u65bc\u4e0d\u540c\u6280\u8853\u7684\u9700\u6c42\u548c\u504f\u597d\u3002<\/p>\n<h2 id=\"mysql-%e7%9a%84%e6%8c%81%e7%ba%8c%e5%8f%97%e6%ad%a1%e8%bf%8e-tVQvMfPlfz\">MySQL \u7684\u6301\u7e8c\u53d7\u6b61\u8fce<\/h2>\n<p>MySQL \u4f5c\u70ba\u4e00\u500b\u958b\u6e90\u7684\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u9577\u671f\u4ee5\u4f86\u4e00\u76f4\u662f\u958b\u767c\u8005\u7684\u9996\u9078\u3002\u5176\u6613\u65bc\u4f7f\u7528\u7684\u7279\u6027\u548c\u5f37\u5927\u7684\u793e\u7fa4\u652f\u6301\u4f7f\u5176\u6210\u70ba\u8a31\u591a\u61c9\u7528\u7a0b\u5e8f\u7684\u57fa\u790e\u3002MySQL \u7684\u6027\u80fd\u512a\u5316\u548c\u64f4\u5c55\u6027\u4f7f\u5176\u9069\u5408\u5f9e\u5c0f\u578b\u7db2\u7ad9\u5230\u5927\u578b\u4f01\u696d\u61c9\u7528\u7684\u5404\u7a2e\u9700\u6c42\u3002<\/p>\n<pre><code>SELECT * FROM users WHERE active = 1;<\/code><\/pre>\n<p>\u4e0a\u8ff0 SQL \u67e5\u8a62\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u5f9e\u7528\u6236\u8868\u4e2d\u9078\u53d6\u6240\u6709\u6d3b\u8e8d\u7528\u6236\uff0c\u9019\u662f MySQL \u4e2d\u5e38\u898b\u7684\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"postgresql-%e7%9a%84%e5%a2%9e%e9%95%b7-tVQvMfPlfz\">PostgreSQL \u7684\u589e\u9577<\/h2>\n<p>PostgreSQL \u662f\u53e6\u4e00\u500b\u53d7\u6b61\u8fce\u7684\u958b\u6e90\u6578\u64da\u5eab\uff0c\u56e0\u5176\u5f37\u5927\u7684\u529f\u80fd\u548c\u9748\u6d3b\u6027\u800c\u53d7\u5230\u958b\u767c\u8005\u7684\u9752\u775e\u3002\u5b83\u652f\u6301\u8907\u96dc\u7684\u67e5\u8a62\u548c\u6578\u64da\u985e\u578b\uff0c\u4e26\u4e14\u5728\u8655\u7406\u5927\u6578\u64da\u96c6\u6642\u8868\u73fe\u51fa\u8272\u3002PostgreSQL \u7684 ACID \u517c\u5bb9\u6027\u548c\u64f4\u5c55\u6027\u4f7f\u5176\u6210\u70ba\u4f01\u696d\u7d1a\u61c9\u7528\u7684\u7406\u60f3\u9078\u64c7\u3002<\/p>\n<pre><code>CREATE TABLE products (\n    id SERIAL PRIMARY KEY,\n    name VARCHAR(100),\n    price NUMERIC(10, 2)\n);<\/code><\/pre>\n<p>\u9019\u6bb5 SQL \u4ee3\u78bc\u5c55\u793a\u4e86\u5982\u4f55\u5728 PostgreSQL \u4e2d\u5275\u5efa\u4e00\u500b\u7522\u54c1\u8868\uff0c\u9019\u662f\u8a31\u591a\u96fb\u5b50\u5546\u52d9\u61c9\u7528\u7684\u57fa\u790e\u3002<\/p>\n<h2 id=\"nosql-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e8%88%88%e8%b5%b7-tVQvMfPlfz\">NoSQL \u6578\u64da\u5eab\u7684\u8208\u8d77<\/h2>\n<p>\u96a8\u8457\u5927\u6578\u64da\u548c\u5be6\u6642\u6578\u64da\u8655\u7406\u9700\u6c42\u7684\u589e\u52a0\uff0cNoSQL \u6578\u64da\u5eab\u5982 MongoDB \u4e5f\u5728 2017 \u5e74\u7372\u5f97\u4e86\u5ee3\u6cdb\u7684\u95dc\u6ce8\u3002MongoDB \u63d0\u4f9b\u4e86\u9748\u6d3b\u7684\u6578\u64da\u6a21\u578b\uff0c\u9069\u5408\u8655\u7406\u975e\u7d50\u69cb\u5316\u6578\u64da\uff0c\u4e26\u4e14\u80fd\u5920\u8f15\u9b06\u64f4\u5c55\u4ee5\u61c9\u5c0d\u9ad8\u6d41\u91cf\u7684\u61c9\u7528\u3002<\/p>\n<pre><code>db.users.find({ age: { $gt: 18 } });<\/code><\/pre>\n<p>\u9019\u6bb5 MongoDB \u67e5\u8a62\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u67e5\u627e\u6240\u6709\u5e74\u9f61\u5927\u65bc 18 \u6b72\u7684\u7528\u6236\uff0c\u9019\u5728\u793e\u4ea4\u5a92\u9ad4\u548c\u5176\u4ed6\u61c9\u7528\u4e2d\u975e\u5e38\u5e38\u898b\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-tVQvMfPlfz\">\u7d50\u8ad6<\/h2>\n<p>2017 \u5e74\u7684 StackOverflow \u6578\u64da\u5eab\u6392\u540d\u986f\u793a\u4e86\u958b\u767c\u8005\u5c0d\u65bc\u4e0d\u540c\u6578\u64da\u5eab\u7684\u504f\u597d\u548c\u9700\u6c42\u3002MySQL \u548c PostgreSQL \u4ecd\u7136\u662f\u95dc\u806f\u6578\u64da\u5eab\u7684\u4f7c\u4f7c\u8005\uff0c\u800c MongoDB \u7b49 NoSQL \u6578\u64da\u5eab\u5247\u5728\u8655\u7406\u975e\u7d50\u69cb\u5316\u6578\u64da\u65b9\u9762\u986f\u793a\u51fa\u5f37\u5927\u7684\u6f5b\u529b\u3002\u96a8\u8457\u6280\u8853\u7684\u767c\u5c55\uff0c\u9019\u4e9b\u6578\u64da\u5eab\u7684\u4f7f\u7528\u60c5\u6cc1\u53ef\u80fd\u6703\u96a8\u4e4b\u8b8a\u5316\uff0c\u4f46\u5b83\u5011\u5728\u958b\u767c\u8005\u793e\u7fa4\u4e2d\u7684\u91cd\u8981\u6027\u7121\u7591\u6703\u6301\u7e8c\u5b58\u5728\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u652f\u6301\u60a8\u7684\u6578\u64da\u5eab\u9700\u6c42\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u5e6b\u52a9\u60a8\u8f15\u9b06\u7ba1\u7406\u548c\u64f4\u5c55\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d222017\u5e74StackOverflow\u767c\u5e03\u7684\u6700\u6d41\u884c\u6578\u64da\u5eab\u6392\u540d\uff0c\u4e86\u89e3\u958b\u767c\u8005\u6700\u9752\u775e\u7684\u6578\u64da\u5eab\u9078\u64c7\u8207\u8da8\u52e2\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-168593","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=168593"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168593\/revisions"}],"predecessor-version":[{"id":168594,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/168593\/revisions\/168594"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=168593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=168593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=168593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}