{"id":5002,"date":"2024-11-14T09:46:54","date_gmt":"2024-11-14T01:46:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5002\/"},"modified":"2024-11-14T09:46:54","modified_gmt":"2024-11-14T01:46:54","slug":"oracle%e6%95%b0%e6%8d%ae%e5%ba%93%e6%80%8e%e4%b9%88%e5%88%9b%e5%bb%ba%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5002\/","title":{"rendered":"oracle\u6570\u636e\u5e93\u600e\u4e48\u521b\u5efa\u8868"},"content":{"rendered":"<blockquote><p>\n  \u5728 oracle \u6570\u636e\u5e93\u4e2d\u521b\u5efa\u8868\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u4f7f\u7528 create table \u8bed\u53e5\u6307\u5b9a\u8868\u7684\u540d\u79f0\u548c\u5217\u5b9a\u4e49\u3002\u8bbe\u7f6e\u7ea6\u675f\uff08\u5982\u679c\u9700\u8981\uff09\u3002\u63d0\u4ea4\u66f4\u6539\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/21\/2024052109541756925.jpg\" class=\"aligncenter\" title=\"oracle\u6570\u636e\u5e93\u600e\u4e48\u521b\u5efa\u8868\u63d2\u56fe\" alt=\"oracle\u6570\u636e\u5e93\u600e\u4e48\u521b\u5efa\u8868\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u521b\u5efa Oracle \u6570\u636e\u5e93\u8868<\/strong><\/p>\n<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\u521b\u5efa\u8868\u662f\u4e00\u9879\u91cd\u8981\u4efb\u52a1\uff0c\u9700\u8981\u7cbe\u786e\u9075\u5faa\u7279\u5b9a\u7684\u6b65\u9aa4\u3002<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u4f7f\u7528 SQL*Plus \u6216\u5176\u4ed6 Oracle \u5ba2\u6237\u5de5\u5177\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u4f7f\u7528 CREATE TABLE \u8bed\u53e5<\/strong><\/p>\n<p>\u8981\u521b\u5efa\u8868\uff0c\u8bf7\u4f7f\u7528 CREATE TABLE \u8bed\u53e5\uff0c\u540e\u8ddf\u8868\u7684\u540d\u79f0\u53ca\u5176\u5217\u5b9a\u4e49\u3002<\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u6307\u5b9a\u5217<\/strong><\/p>\n<p>\u5728\u5217\u5b9a\u4e49\u4e2d\uff0c\u60a8\u9700\u8981\u6307\u5b9a\u5217\u7684\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\uff08\u4f8b\u5982\u4e3b\u952e\u3001\u5916\u952e\u548c\u975e\u7a7a\u9650\u5236\uff09\u3002<\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u8bbe\u7f6e\u7ea6\u675f<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u5728\u8868\u4e0a\u8bbe\u7f6e\u7ea6\u675f\uff0c\u53ef\u4ee5\u5728 CREATE TABLE \u8bed\u53e5\u4e2d\u4f7f\u7528 CONSTRAINT \u5b50\u53e5\u3002\u7ea6\u675f\u662f\u5f3a\u5236\u6570\u636e\u5b8c\u6574\u6027\u548c\u786e\u4fdd\u6570\u636e\u51c6\u786e\u6027\u7684\u89c4\u5219\u3002<\/p>\n<p><strong>\u6b65\u9aa4 5\uff1a\u63d0\u4ea4\u66f4\u6539<\/strong><\/p>\n<p>\u4e00\u65e6\u60a8\u5b9a\u4e49\u4e86\u8868\u7ed3\u6784\uff0c\u8bf7\u4f7f\u7528 COMMIT \u8bed\u53e5\u63d0\u4ea4\u66f4\u6539\uff0c\u4f7f\u5176\u6c38\u4e45\u4fdd\u5b58\u3002<\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u662f\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a &#8220;employees&#8221; \u7684\u8868\u7684\u793a\u4f8b\uff1a<\/p>\n<pre>CREATE TABLE employees (\n  employee_id NUMBER(6) PRIMARY KEY,\n  first_name VARCHAR2(20) NOT NULL,\n  last_name VARCHAR2(20) NOT NULL,\n  email VARCHAR2(50) UNIQUE,\n  salary NUMBER(8,2)\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u4e2a\u793a\u4f8b\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a &#8220;employees&#8221; \u7684\u8868\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u5217\uff1a<\/p>\n<ul>\n<li>employee_id\uff1a\u4e3b\u952e\u6807\u8bc6\u7b26<\/li>\n<li>first_name\uff1a\u5458\u5de5\u540d<\/li>\n<li>last_name\uff1a\u5458\u5de5\u59d3\u6c0f<\/li>\n<li>email\uff1a\u552f\u4e00\u7535\u5b50\u90ae\u4ef6\u5730\u5740<\/li>\n<li>salary\uff1a\u5458\u5de5\u5de5\u8d44<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u8868\u540d\u548c\u5217\u540d\u7b26\u5408 Oracle \u6807\u8bc6\u7b26\u547d\u540d\u89c4\u5219\u3002<\/li>\n<li>\u9009\u62e9\u9002\u5f53\u7684\u6570\u636e\u7c7b\u578b\u4ee5\u5b58\u50a8\u6570\u636e\u3002<\/li>\n<li>\u8003\u8651\u6dfb\u52a0\u9002\u5f53\u7684\u7ea6\u675f\u4ee5\u4fdd\u6301\u6570\u636e\u5b8c\u6574\u6027\u3002<\/li>\n<li>\u5728\u63d0\u4ea4\u4e4b\u524d\u4ed4\u7ec6\u68c0\u67e5 CREATE TABLE \u8bed\u53e5\u4ee5\u786e\u4fdd\u5b83\u6b63\u786e\u65e0\u8bef\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u600e\u4e48\u521b\u5efa\u8868\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>\u5728 oracle \u6570\u636e\u5e93\u4e2d\u521b\u5efa\u8868\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u4f7f\u7528 create table \u8bed\u53e5\u6307\u5b9a\u8868\u7684\u540d\u79f0\u548c\u5217\u5b9a\u4e49\u3002\u8bbe\u7f6e\u7ea6\u675f\uff08\u5982\u679c\u9700\u8981\uff09\u3002\u63d0\u4ea4\u66f4\u6539\u3002 \u5982\u4f55\u521b\u5efa Oracle \u6570\u636e\u5e93\u8868 \u5728 Oracle \u6570\u636e\u5e93\u4e2d\u521b\u5efa\u8868\u662f\u4e00\u9879\u91cd\u8981\u4efb\u52a1\uff0c\u9700\u8981\u7cbe\u786e\u9075\u5faa\u7279\u5b9a\u7684\u6b65\u9aa4\u3002 \u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93 \u9996\u5148\uff0c\u4f7f\u7528 SQL*Plus \u6216\u5176\u4ed6 Oracle \u5ba2\u6237\u5de5\u5177\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002 \u6b65\u9aa4 2\uff1a\u4f7f\u7528 CREATE TABLE \u8bed\u53e5 \u8981\u521b\u5efa\u8868\uff0c\u8bf7\u4f7f\u7528 CREATE TABLE \u8bed\u53e5\uff0c\u540e\u8ddf\u8868\u7684\u540d\u79f0\u53ca\u5176\u5217\u5b9a\u4e49\u3002 \u6b65\u9aa4 3\uff1a\u6307\u5b9a\u5217 \u5728\u5217\u5b9a\u4e49\u4e2d\uff0c\u60a8\u9700\u8981\u6307\u5b9a\u5217\u7684\u540d\u79f0\u3001\u6570\u636e\u7c7b\u578b\u548c\u7ea6\u675f\uff08\u4f8b\u5982\u4e3b\u952e\u3001\u5916\u952e\u548c\u975e\u7a7a\u9650\u5236\uff09\u3002 \u6b65\u9aa4 4\uff1a\u8bbe\u7f6e\u7ea6\u675f \u5982\u679c\u60a8\u9700\u8981\u5728\u8868\u4e0a\u8bbe\u7f6e\u7ea6\u675f\uff0c\u53ef\u4ee5\u5728 CREATE TABLE \u8bed\u53e5\u4e2d\u4f7f\u7528 CONSTRAINT \u5b50\u53e5\u3002\u7ea6\u675f\u662f\u5f3a\u5236\u6570\u636e\u5b8c\u6574\u6027\u548c\u786e\u4fdd\u6570\u636e\u51c6\u786e\u6027\u7684\u89c4\u5219\u3002 \u6b65\u9aa4 5\uff1a\u63d0\u4ea4\u66f4\u6539 \u4e00\u65e6\u60a8\u5b9a\u4e49\u4e86\u8868\u7ed3\u6784\uff0c\u8bf7\u4f7f\u7528 COMMIT \u8bed\u53e5\u63d0\u4ea4\u66f4\u6539\uff0c\u4f7f\u5176\u6c38\u4e45\u4fdd\u5b58\u3002 \u793a\u4f8b\uff1a \u4ee5\u4e0b\u662f\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a &#8220;employees&#8221; \u7684\u8868\u7684\u793a\u4f8b\uff1a CREATE TABLE employees ( employee_id NUMBER(6) PRIMARY [&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-5002","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5002","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=5002"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5002\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}