{"id":5205,"date":"2024-11-14T13:18:10","date_gmt":"2024-11-14T05:18:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5205\/"},"modified":"2024-11-14T13:18:10","modified_gmt":"2024-11-14T05:18:10","slug":"sql-desc%e6%80%8e%e4%b9%88%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5205\/","title":{"rendered":"sql\u00a0desc\u600e\u4e48\u7528"},"content":{"rendered":"<blockquote><p>\n  sql desc \u547d\u4ee4\u7528\u4e8e\u63cf\u8ff0\u6570\u636e\u5e93\u8868\u7684\u7ed3\u6784\u4fe1\u606f\uff0c\u5305\u62ec\u5217\u540d\u3001\u6570\u636e\u7c7b\u578b\u3001\u7ea6\u675f\u7b49\u5c5e\u6027\u3002\u8bed\u6cd5\u4e3a\uff1adesc [table | view] table_name; \u53c2\u6570\uff1a1. table | view\uff1a\u53ef\u9009\uff0c\u6307\u5b9a\u5bf9\u8c61\u7c7b\u578b\uff1b2. table_name\uff1a\u8981\u63cf\u8ff0\u7684\u8868\u7684\u540d\u79f0\u3002\u793a\u4f8b\uff1adesc customers; \u8f93\u51fa\u5b57\u6bb5\u5305\u62ec\uff1afield\uff08\u5217\u540d\uff09\u3001type\uff08\u6570\u636e\u7c7b\u578b\uff09\u3001null\uff08\u662f\u5426\u5141\u8bb8\u7a7a\u503c\uff09\u3001key\uff08\u952e\u7ea6\u675f\uff09\u3001default\uff08\u9ed8\u8ba4\u503c\uff09\u3001extra\uff08\u989d\u5916\u4fe1\u606f\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/24\/2024052420392161661.jpg\" class=\"aligncenter\" title=\"sql\u00a0desc\u600e\u4e48\u7528\u63d2\u56fe\" alt=\"sql\u00a0desc\u600e\u4e48\u7528\u63d2\u56fe\" \/><\/p>\n<p><strong>SQL DESC \u547d\u4ee4\u7684\u7528\u6cd5<\/strong><\/p>\n<p>SQL DESC \u547d\u4ee4\u7528\u4e8e\u63cf\u8ff0\u8868\u6216\u89c6\u56fe\u7684\u7ed3\u6784\u4fe1\u606f\uff0c\u5305\u62ec\u5217\u540d\u3001\u6570\u636e\u7c7b\u578b\u3001\u7ea6\u675f\u7b49\u5c5e\u6027\u3002<\/p>\n<p><strong>\u8bed\u6cd5<\/strong><\/p>\n<pre>DESC [TABLE | VIEW] table_name;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u53c2\u6570<\/strong><\/p>\n<ul>\n<li> <strong>TABLE | VIEW<\/strong>\uff1a\u53ef\u9009\u53c2\u6570\uff0c\u6307\u5b9a\u8981\u63cf\u8ff0\u7684\u6570\u636e\u5e93\u5bf9\u8c61\u7c7b\u578b\u3002<\/li>\n<li> <strong>table_name<\/strong>\uff1a\u8981\u63cf\u8ff0\u7684\u8868\u7684\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<p>\u4ee5\u4e0b\u67e5\u8be2\u63cf\u8ff0\u540d\u4e3a &#8220;customers&#8221; \u7684\u8868\u7684\u7ed3\u6784\u4fe1\u606f\uff1a<\/p>\n<pre>DESC customers;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8f93\u51fa\u7ed3\u679c\u7c7b\u4f3c\u4e8e\uff1a<\/p>\n<pre>Field | Type | Null | Key | Default | Extra\n-------+------+------+-----+---------+------\nid | int | NO | PRI | NULL | auto_increment\nname | varchar(255) | YES | | NULL |\nemail | varchar(255) | YES | | NULL |<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u8f93\u51fa\u5b57\u6bb5<\/strong><\/p>\n<ul>\n<li> <strong>Field<\/strong>\uff1a\u5217\u7684\u540d\u79f0\u3002<\/li>\n<li> <strong>Type<\/strong>\uff1a\u5217\u7684\u6570\u636e\u7c7b\u578b\u3002<\/li>\n<li> <strong>Null<\/strong>\uff1a\u6307\u793a\u5217\u662f\u5426\u5141\u8bb8\u7a7a\u503c\uff08YES\/NO\uff09\u3002<\/li>\n<li> <strong>Key<\/strong>\uff1a\u6307\u793a\u5217\u662f\u5426\u4e3a\u4e3b\u952e\uff08PRI\uff09\u3001\u552f\u4e00\u952e\uff08UNI\uff09\u6216\u5916\u952e\uff08FOR\uff09\u3002<\/li>\n<li> <strong>Default<\/strong>\uff1a\u6307\u5b9a\u5217\u7684\u9ed8\u8ba4\u503c\u3002<\/li>\n<li> <strong>Extra<\/strong>\uff1a\u63d0\u4f9b\u989d\u5916\u4fe1\u606f\uff0c\u4f8b\u5982\u5217\u662f\u5426\u4e3a\u81ea\u52a8\u9012\u589e\u5217\uff08auto_increment\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u7528\u9014<\/strong><\/p>\n<p><strong>\u4e86\u89e3\u8868\u7ed3\u6784\uff1a<\/strong>DESC \u547d\u4ee4\u53ef\u7528\u4e8e\u4e86\u89e3\u8868\u7684\u5217\u540d\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\u7b49\u4fe1\u606f\u3002<\/p>\n<p><strong>\u8c03\u8bd5\u67e5\u8be2\uff1a<\/strong>\u5728\u7f16\u5199\u67e5\u8be2\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 DESC \u547d\u4ee4\u786e\u4fdd\u6b63\u5728\u4f7f\u7528\u6b63\u786e\u7684\u5217\u540d\u548c\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<p><strong>\u751f\u6210\u67b6\u6784\u6587\u6863\uff1a<\/strong>\u53ef\u4ee5\u5c06 DESC \u547d\u4ee4\u4f5c\u4e3a\u751f\u6210\u8868\u67b6\u6784\u6587\u6863\u7684\u5de5\u5177\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fsql&nbsp;desc\u600e\u4e48\u7528\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sql desc \u547d\u4ee4\u7528\u4e8e\u63cf\u8ff0\u6570\u636e\u5e93\u8868\u7684\u7ed3\u6784\u4fe1\u606f\uff0c\u5305\u62ec\u5217\u540d\u3001\u6570\u636e\u7c7b\u578b\u3001\u7ea6\u675f\u7b49\u5c5e\u6027\u3002\u8bed\u6cd5\u4e3a\uff1adesc [table | view] table_name; \u53c2\u6570\uff1a1. table | view\uff1a\u53ef\u9009\uff0c\u6307\u5b9a\u5bf9\u8c61\u7c7b\u578b\uff1b2. table_name\uff1a\u8981\u63cf\u8ff0\u7684\u8868\u7684\u540d\u79f0\u3002\u793a\u4f8b\uff1adesc customers; \u8f93\u51fa\u5b57\u6bb5\u5305\u62ec\uff1afield\uff08\u5217\u540d\uff09\u3001type\uff08\u6570\u636e\u7c7b\u578b\uff09\u3001null\uff08\u662f\u5426\u5141\u8bb8\u7a7a\u503c\uff09\u3001key\uff08\u952e\u7ea6\u675f\uff09\u3001default\uff08\u9ed8\u8ba4\u503c\uff09\u3001extra\uff08\u989d\u5916\u4fe1\u606f\uff09\u3002 SQL DESC \u547d\u4ee4\u7684\u7528\u6cd5 SQL DESC \u547d\u4ee4\u7528\u4e8e\u63cf\u8ff0\u8868\u6216\u89c6\u56fe\u7684\u7ed3\u6784\u4fe1\u606f\uff0c\u5305\u62ec\u5217\u540d\u3001\u6570\u636e\u7c7b\u578b\u3001\u7ea6\u675f\u7b49\u5c5e\u6027\u3002 \u8bed\u6cd5 DESC [TABLE | VIEW] table_name; \u767b\u5f55\u540e\u590d\u5236 \u53c2\u6570 TABLE | VIEW\uff1a\u53ef\u9009\u53c2\u6570\uff0c\u6307\u5b9a\u8981\u63cf\u8ff0\u7684\u6570\u636e\u5e93\u5bf9\u8c61\u7c7b\u578b\u3002 table_name\uff1a\u8981\u63cf\u8ff0\u7684\u8868\u7684\u540d\u79f0\u3002 \u793a\u4f8b \u4ee5\u4e0b\u67e5\u8be2\u63cf\u8ff0\u540d\u4e3a &#8220;customers&#8221; \u7684\u8868\u7684\u7ed3\u6784\u4fe1\u606f\uff1a DESC customers; \u767b\u5f55\u540e\u590d\u5236 \u8f93\u51fa\u7ed3\u679c\u7c7b\u4f3c\u4e8e\uff1a Field | Type | Null | Key | Default | Extra &#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8211;+&#8212;&#8212;&#8212;+&#8212;&#8212; id | int [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5205","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5205"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5205\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}