{"id":217771,"date":"2023-12-22T23:59:22","date_gmt":"2023-12-22T15:59:22","guid":{"rendered":"https:\/\/www.idc.net\/help\/217771\/"},"modified":"2023-12-22T23:59:22","modified_gmt":"2023-12-22T15:59:22","slug":"mysql%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c%ef%bc%9a%e4%bd%bf%e7%94%a8create-table-table-column1-type-column2-type%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aa%e6%96%b0%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/217771\/","title":{"rendered":"MySQL\u4f7f\u7528\u624b\u518c\uff1a\u4f7f\u7528CREATE TABLE [table] (column1 type, column2 type)\u521b\u5efa\u4e00\u4e2a\u65b0\u8868"},"content":{"rendered":"<p><title id=\"mysql%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c%ef%bc%9a%e4%bd%bf%e7%94%a8create-table-table-column1-type-column2-type%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aa%e6%96%b0%e8%a1%a8-Enuqyyfugc\">MySQL\u4f7f\u7528\u624b\u518c\uff1a\u4f7f\u7528CREATE TABLE [table] (column1 type, column2 type)\u521b\u5efa\u4e00\u4e2a\u65b0\u8868<\/title><\/p>\n<h1 id=\"mysql%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c%ef%bc%9a%e4%bd%bf%e7%94%a8create-table-table-column1-type-column2-type%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aa%e6%96%b0%e8%a1%a8-Enuqyyfugc\">MySQL\u4f7f\u7528\u624b\u518c\uff1a\u4f7f\u7528CREATE TABLE [table] (column1 type, column2 type)\u521b\u5efa\u4e00\u4e2a\u65b0\u8868<\/h1>\n<h2 id=\"%e4%bb%8b%e7%bb%8d-Enuqyyfugc\">\u4ecb\u7ecd<\/h2>\n<p>MySQL\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5e7f\u6cdb\u7528\u4e8eWeb\u5e94\u7528\u7a0b\u5e8f\u548c\u5176\u4ed6\u6570\u636e\u9a71\u52a8\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002\u5728MySQL\u4e2d\uff0c\u4f7f\u7528CREATE TABLE\u8bed\u53e5\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u8868\u3002<\/p>\n<h2 id=\"create-table%e8%af%ad%e6%b3%95-Enuqyyfugc\">CREATE TABLE\u8bed\u6cd5<\/h2>\n<p>CREATE TABLE\u8bed\u53e5\u7684\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>CREATE TABLE [table] (\n    column1 type,\n    column2 type,\n    ...\n);\n<\/code><\/pre>\n<p>\u5176\u4e2d\uff0c[table]\u662f\u8981\u521b\u5efa\u7684\u8868\u7684\u540d\u79f0\uff0ccolumn1\u3001column2\u7b49\u662f\u8868\u4e2d\u7684\u5217\u540d\uff0ctype\u662f\u5217\u7684\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<h2 id=\"%e7%a4%ba%e4%be%8b-Enuqyyfugc\">\u793a\u4f8b<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528CREATE TABLE\u8bed\u53e5\u521b\u5efa\u8868\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>CREATE TABLE employees (\n    id INT,\n    name VARCHAR(50),\n    age INT,\n    salary DECIMAL(10,2)\n);\n<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u793a\u4f8b\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3aemployees\u7684\u8868\uff0c\u5305\u542b\u4e86id\u3001name\u3001age\u548csalary\u56db\u4e2a\u5217\u3002\u5176\u4e2d\uff0cid\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fINT\uff0cname\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fVARCHAR(50)\uff0cage\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fINT\uff0csalary\u5217\u7684\u6570\u636e\u7c7b\u578b\u662fDECIMAL(10,2)\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e7%94%a8%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b-Enuqyyfugc\">\u5e38\u7528\u7684\u6570\u636e\u7c7b\u578b<\/h2>\n<p>\u5728MySQL\u4e2d\uff0c\u6709\u8bb8\u591a\u4e0d\u540c\u7684\u6570\u636e\u7c7b\u578b\u53ef\u4f9b\u9009\u62e9\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u6570\u636e\u7c7b\u578b\uff1a<\/p>\n<ul>\n<li>INT\uff1a\u6574\u6570\u7c7b\u578b<\/li>\n<li>VARCHAR\uff1a\u53ef\u53d8\u957f\u5ea6\u5b57\u7b26\u4e32\u7c7b\u578b<\/li>\n<li>DECIMAL\uff1a\u5b9a\u70b9\u6570\u7c7b\u578b<\/li>\n<li>DATE\uff1a\u65e5\u671f\u7c7b\u578b<\/li>\n<li>TIME\uff1a\u65f6\u95f4\u7c7b\u578b<\/li>\n<li>DATETIME\uff1a\u65e5\u671f\u65f6\u95f4\u7c7b\u578b<\/li>\n<\/ul>\n<h2 id=\"%e6%80%bb%e7%bb%93-Enuqyyfugc\">\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u4f7f\u7528CREATE TABLE\u8bed\u53e5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728MySQL\u4e2d\u521b\u5efa\u65b0\u7684\u6570\u636e\u5e93\u8868\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u64cd\u4f5c\uff0c\u56e0\u4e3a\u8868\u662f\u5b58\u50a8\u548c\u7ec4\u7ec7\u6570\u636e\u7684\u57fa\u672c\u5355\u4f4d\u3002\u5728\u521b\u5efa\u8868\u65f6\uff0c\u6211\u4eec\u9700\u8981\u6307\u5b9a\u8868\u7684\u540d\u79f0\u548c\u5217\u7684\u540d\u79f0\u53ca\u5176\u5bf9\u5e94\u7684\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u4e91\u8ba1\u7b97\u670d\u52a1\u63d0\u4f9b\u5546\uff0c\u540e\u6d6a\u4e91\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002\u4ed6\u4eec\u63d0\u4f9b\u9999\u6e2f\u670d\u52a1\u5668\u3001\u7f8e\u56fd\u670d\u52a1\u5668\u548c\u4e91\u670d\u52a1\u5668\u7b49\u591a\u79cd\u4ea7\u54c1\u3002\u60a8\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/idc.net\">\u540e\u6d6a\u4e91\u5b98\u7f51<\/a>\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u4f7f\u7528\u624b\u518c\uff1a\u4f7f\u7528CREATE TABLE [table] (column1 type, column2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197851],"tags":[],"class_list":["post-217771","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/217771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=217771"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/217771\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=217771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=217771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=217771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}