{"id":15791,"date":"2023-12-04T22:54:36","date_gmt":"2023-12-04T14:54:36","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15791"},"modified":"2023-12-04T22:55:39","modified_gmt":"2023-12-04T14:55:39","slug":"oracle-zhong-jian-shu-oracle-zhong-dmlddldcl-dou-s","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-jian-shu-oracle-zhong-dmlddldcl-dou-s\/","title":{"rendered":"Oracle \u4e2d\u7b80\u8ff0 Oracle \u4e2d dml\u3001ddl\u3001dcl \u90fd\u662f\u4ec0\u4e48\u610f\u601d\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0cDML\u3001DDL \u548c DCL \u662f\u4e09\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 SQL \u8bed\u53e5\uff0c\u7528\u4e8e\u6267\u884c\u4e0d\u540c\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n<h3>1. DML\uff08Data Manipulation Language\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u542b\u4e49\uff1a<\/strong>\n<ul>\n<li>DML \u662f\u7528\u4e8e\u7ba1\u7406\u8868\u4e2d\u6570\u636e\u7684 SQL \u8bed\u53e5\u3002\u5b83\u5305\u62ec\u63d2\u5165\uff08INSERT\uff09\u3001\u66f4\u65b0\uff08UPDATE\uff09\u3001\u5220\u9664\uff08DELETE\uff09\u7b49\u64cd\u4f5c\uff0c\u7528\u4e8e\u5bf9\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u589e\u3001\u5220\u3001\u6539\u7684\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u793a\u4f8b\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">-- \u63d2\u5165\u6570\u636e\nINSERT INTO employees (employee_id, first_name, last_name) VALUES (1, 'John', 'Doe');\n\n-- \u66f4\u65b0\u6570\u636e\nUPDATE employees SET salary = salary * 1.1 WHERE department_id = 10;\n\n-- \u5220\u9664\u6570\u636e\nDELETE FROM employees WHERE employee_id = 1;\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>2. DDL\uff08Data Definition Language\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u542b\u4e49\uff1a<\/strong>\n<ul>\n<li>DDL \u7528\u4e8e\u5b9a\u4e49\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u7ed3\u6784\uff0c\u4f8b\u5982\u8868\u3001\u7d22\u5f15\u3001\u89c6\u56fe\u7b49\u3002\u5b83\u5305\u62ec\u521b\u5efa\uff08CREATE\uff09\u3001\u4fee\u6539\uff08ALTER\uff09\u3001\u5220\u9664\uff08DROP\uff09\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u8bed\u53e5\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u793a\u4f8b\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">-- \u521b\u5efa\u8868\nCREATE TABLE employees (\nemployee_id NUMBER,\nfirst_name VARCHAR2(50),\nlast_name VARCHAR2(50),\nsalary NUMBER\n);\n\n-- \u4fee\u6539\u8868\u7ed3\u6784\nALTER TABLE employees ADD hire_date DATE;\n\n-- \u5220\u9664\u8868\nDROP TABLE employees;\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>3. DCL\uff08Data Control Language\uff09\uff1a<\/h3>\n<ul>\n<li><strong>\u542b\u4e49\uff1a<\/strong>\n<ul>\n<li>DCL \u7528\u4e8e\u63a7\u5236\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\u548c\u4e8b\u52a1\u7684\u63d0\u4ea4\u6216\u56de\u6eda\u3002\u5b83\u5305\u62ec\u6388\u6743\uff08GRANT\uff09\u3001\u56de\u6536\u6388\u6743\uff08REVOKE\uff09\u3001\u63d0\u4ea4\u4e8b\u52a1\uff08COMMIT\uff09\u548c\u56de\u6eda\u4e8b\u52a1\uff08ROLLBACK\uff09\u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u793a\u4f8b\uff1a<\/strong>\n<pre><code class=\"language-sql  line-numbers\">-- \u6388\u6743\nGRANT SELECT, INSERT ON employees TO user1;\n\n-- \u56de\u6536\u6388\u6743\nREVOKE SELECT ON employees FROM user1;\n\n-- \u63d0\u4ea4\u4e8b\u52a1\nCOMMIT;\n\n-- \u56de\u6eda\u4e8b\u52a1\nROLLBACK;\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u603b\u4f53\u800c\u8a00\uff0cDML \u7528\u4e8e\u6570\u636e\u7684\u64cd\u4f5c\uff0cDDL \u7528\u4e8e\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u5b9a\u4e49\uff0cDCL \u7528\u4e8e\u63a7\u5236\u6570\u636e\u5e93\u8bbf\u95ee\u6743\u9650\u548c\u4e8b\u52a1\u7684\u63d0\u4ea4\u6216\u56de\u6eda\u3002\u8fd9\u4e09\u79cd\u7c7b\u578b\u7684 SQL \u8bed\u53e5\u5728\u6570\u636e\u5e93\u7ba1\u7406\u4e2d\u626e\u6f14\u7740\u4e0d\u540c\u7684\u89d2\u8272\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0cDML\u3001DDL \u548c DCL \u662f\u4e09\u79cd\u4e0d\u540c\u7c7b\u578b\u7684 SQL \u8bed\u53e5\uff0c\u7528\u4e8e\u6267\u884c\u4e0d\u540c\u7684\u6570\u636e\u5e93\u64cd [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15791","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15791"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15791\/revisions"}],"predecessor-version":[{"id":15792,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15791\/revisions\/15792"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15791"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}