{"id":1630,"date":"2015-11-13T10:00:07","date_gmt":"2015-11-13T02:00:07","guid":{"rendered":"http:\/\/www.821121.com\/?p=1630"},"modified":"2022-04-21T10:19:13","modified_gmt":"2022-04-21T02:19:13","slug":"oracle%e5%90%91%e8%a1%a8%e4%b8%ad%e6%b7%bb%e5%8a%a0%e5%88%97%e3%80%81%e7%ba%a6%e6%9d%9f","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1630","title":{"rendered":"Oracle\u5411\u8868\u4e2d\u6dfb\u52a0\u5217\u3001\u7ea6\u675f"},"content":{"rendered":"<h1>Oracle\u6dfb\u52a0\u5217\u7684\u683c\u5f0f<\/h1>\n<h4>\u6dfb\u52a0\u4e00\u5217<\/h4>\n<pre><code class=\"language-sql\">ALTER TABLE table_name ADD column_name data_type constraint;<\/code><\/pre>\n<h4>\u6dfb\u52a0\u591a\u5217<\/h4>\n<pre><code class=\"language-sql\">ALTER TABLE table_name \nADD (\n    column_name_1 data_type constraint,\n    column_name_2 data_type constraint,\n    ...\n);<\/code><\/pre>\n<h1>Oracle\u6dfb\u52a0\u7ea6\u675f\u7684\u683c\u5f0f<\/h1>\n<p><strong><em>\u88ab\u5f15\u7528\u7684\u5916\u952e\u5fc5\u987b\u662f\u552f\u4e00\u7684<br \/>\n\u4e00\u5f20\u8868\u4e2d\u7684\u4e3b\u952e\uff0c\u53ef\u4ee5\u540c\u65f6\u662f\u53e6\u5916\u4e00\u5f20\u8868\u7684\u5916\u952e\uff0c\u4f46\u662f\u6570\u636e\u7c7b\u578b\u8981\u4e00\u81f4<\/em><\/strong><\/p>\n<h4>\u6dfb\u52a0\u5916\u952e\u7ea6\u675f<\/h4>\n<pre><code class=\"language-sql\">alter table \u4e3b\u8868\u540d \n      add constraint \u5916\u952e\u540d \n      foreign key(\u5b57\u6bb5\u540d) \n      references \u88ab\u5f15\u7528\u7684\u8868\u540d(\u5b57\u6bb5\u540d);<\/code><\/pre>\n<h4>\u6dfb\u52a0\u4e3b\u952e\u7ea6\u675f<\/h4>\n<pre><code class=\"language-sql\">alter table \u8868\u540d add constraint \u4e3b\u952e\u540d primary key(\u5b57\u6bb5\u540d);<\/code><\/pre>\n<h4>\u6dfb\u52a0\u552f\u4e00\u7ea6\u675f<\/h4>\n<pre><code class=\"language-sql\">alter table \u8868\u540d add constraint \u7ea6\u675f\u540d unique(\u5b57\u6bb5\u540d);<\/code><\/pre>\n<h4>\u6dfb\u52a0\u68c0\u67e5\u7ea6\u675f<\/h4>\n<pre><code class=\"language-sql\">alter table \u8868\u540d add constraint \u7ea6\u675f\u540d check(\u7ea6\u675f\u6761\u4ef6);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Oracle\u6dfb\u52a0\u5217\u7684\u683c\u5f0f \u6dfb\u52a0\u4e00\u5217 ALTER T<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,1],"tags":[],"class_list":["post-1630","post","type-post","status-publish","format-standard","hentry","category-sql","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1630"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1630\/revisions"}],"predecessor-version":[{"id":1684,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1630\/revisions\/1684"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1630"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}