{"id":93764,"date":"2024-10-19T16:43:18","date_gmt":"2024-10-19T08:43:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/93764\/"},"modified":"2024-10-19T16:43:18","modified_gmt":"2024-10-19T08:43:18","slug":"oracle-10g-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b7%b4%e7%bf%92%e9%a1%8c-oracle10g-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%bf%92%e9%a1%8c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/93764\/","title":{"rendered":"ORACLE 10G \u6578\u64da\u5eab\u7df4\u7fd2\u984c (oracle10g \u6578\u64da\u5eab\u7fd2\u984c)"},"content":{"rendered":"<h1 id=\"oracle-10g-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b7%b4%e7%bf%92%e9%a1%8c-oracle10g-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%bf%92%e9%a1%8c-XiIPZAExIw\">ORACLE 10G \u6578\u64da\u5eab\u7df4\u7fd2\u984c (oracle10g \u6578\u64da\u5eab\u7fd2\u984c)<\/h1>\n<p>Oracle 10g \u662f\u4e00\u6b3e\u529f\u80fd\u5f37\u5927\u7684\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u4f01\u696d\u7d1a\u61c9\u7528\u4e2d\u3002\u70ba\u4e86\u5e6b\u52a9\u5b78\u7fd2\u8005\u66f4\u597d\u5730\u638c\u63e1 Oracle 10g \u7684\u4f7f\u7528\uff0c\u672c\u6587\u5c07\u63d0\u4f9b\u4e00\u4e9b\u7df4\u7fd2\u984c\uff0c\u6db5\u84cb\u57fa\u672c\u7684 SQL \u67e5\u8a62\u3001\u6578\u64da\u5eab\u8a2d\u8a08\u53ca\u6027\u80fd\u512a\u5316\u7b49\u65b9\u9762\u3002<\/p>\n<h2 id=\"%e5%9f%ba%e6%9c%ac-sql-%e6%9f%a5%e8%a9%a2%e7%b7%b4%e7%bf%92-XiIPZAExIw\">\u57fa\u672c SQL \u67e5\u8a62\u7df4\u7fd2<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7684 SQL \u67e5\u8a62\u7df4\u7fd2\u984c\uff0c\u5e6b\u52a9\u5b78\u7fd2\u8005\u719f\u6089 Oracle 10g \u7684\u67e5\u8a62\u8a9e\u6cd5\u3002<\/p>\n<ul>\n<li><strong>\u984c\u76ee 1\uff1a<\/strong>\u67e5\u8a62\u54e1\u5de5\u8868\u4e2d\u6240\u6709\u54e1\u5de5\u7684\u59d3\u540d\u548c\u5de5\u8cc7\u3002<\/li>\n<pre><code>SELECT name, salary FROM employees;<\/code><\/pre>\n<li><strong>\u984c\u76ee 2\uff1a<\/strong>\u67e5\u8a62\u5de5\u8cc7\u9ad8\u65bc 5000 \u7684\u54e1\u5de5\u59d3\u540d\u53ca\u5176\u90e8\u9580\u3002<\/li>\n<pre><code>SELECT name, department FROM employees WHERE salary &gt; 5000;<\/code><\/pre>\n<li><strong>\u984c\u76ee 3\uff1a<\/strong>\u8a08\u7b97\u6bcf\u500b\u90e8\u9580\u7684\u5e73\u5747\u5de5\u8cc7\u3002<\/li>\n<pre><code>SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department;<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a8%ad%e8%a8%88%e7%b7%b4%e7%bf%92-XiIPZAExIw\">\u6578\u64da\u5eab\u8a2d\u8a08\u7df4\u7fd2<\/h2>\n<p>\u6578\u64da\u5eab\u8a2d\u8a08\u662f\u6578\u64da\u5eab\u7ba1\u7406\u7684\u91cd\u8981\u7d44\u6210\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u8a2d\u8a08\u76f8\u95dc\u7684\u7df4\u7fd2\u984c\u3002<\/p>\n<ul>\n<li><strong>\u984c\u76ee 1\uff1a<\/strong>\u8a2d\u8a08\u4e00\u500b\u5b78\u751f\u8868\uff0c\u5305\u542b\u5b78\u865f\u3001\u59d3\u540d\u3001\u5e74\u9f61\u548c\u5c08\u696d\u7b49\u5b57\u6bb5\u3002<\/li>\n<pre><code>CREATE TABLE students (\n        student_id NUMBER PRIMARY KEY,\n        name VARCHAR2(100),\n        age NUMBER,\n        major VARCHAR2(100)\n    );<\/code><\/pre>\n<li><strong>\u984c\u76ee 2\uff1a<\/strong>\u8a2d\u8a08\u4e00\u500b\u8ab2\u7a0b\u8868\uff0c\u5305\u542b\u8ab2\u7a0b\u7de8\u865f\u3001\u8ab2\u7a0b\u540d\u7a31\u548c\u5b78\u5206\u7b49\u5b57\u6bb5\u3002<\/li>\n<pre><code>CREATE TABLE courses (\n        course_id NUMBER PRIMARY KEY,\n        course_name VARCHAR2(100),\n        credits NUMBER\n    );<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e6%80%a7%e8%83%bd%e5%84%aa%e5%8c%96%e7%b7%b4%e7%bf%92-XiIPZAExIw\">\u6027\u80fd\u512a\u5316\u7df4\u7fd2<\/h2>\n<p>\u6027\u80fd\u512a\u5316\u662f\u78ba\u4fdd\u6578\u64da\u5eab\u9ad8\u6548\u904b\u884c\u7684\u95dc\u9375\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6027\u80fd\u512a\u5316\u7684\u7df4\u7fd2\u984c\u3002<\/p>\n<ul>\n<li><strong>\u984c\u76ee 1\uff1a<\/strong>\u5982\u4f55\u4f7f\u7528\u7d22\u5f15\u4f86\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\uff1f\u8acb\u8209\u4f8b\u8aaa\u660e\u3002<\/li>\n<pre><code>CREATE INDEX idx_employee_name ON employees(name);<\/code><\/pre>\n<li><strong>\u984c\u76ee 2\uff1a<\/strong>\u89e3\u91cb\u4ec0\u9ebc\u662f\u57f7\u884c\u8a08\u5283\uff0c\u4e26\u5982\u4f55\u67e5\u770b\u4e00\u500b SQL \u67e5\u8a62\u7684\u57f7\u884c\u8a08\u5283\u3002<\/li>\n<pre><code>EXPLAIN PLAN FOR SELECT * FROM employees WHERE salary &gt; 5000;<\/code><\/pre>\n<pre><code>SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e9%80%b2%e9%9a%8e-sql-%e6%9f%a5%e8%a9%a2%e7%b7%b4%e7%bf%92-XiIPZAExIw\">\u9032\u968e SQL \u67e5\u8a62\u7df4\u7fd2<\/h2>\n<p>\u9032\u968e SQL \u67e5\u8a62\u80fd\u5920\u5e6b\u52a9\u5b78\u7fd2\u8005\u66f4\u6df1\u5165\u5730\u7406\u89e3\u6578\u64da\u5eab\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u9032\u968e\u67e5\u8a62\u7684\u7df4\u7fd2\u984c\u3002<\/p>\n<ul>\n<li><strong>\u984c\u76ee 1\uff1a<\/strong>\u67e5\u8a62\u6bcf\u500b\u90e8\u9580\u4e2d\u5de5\u8cc7\u6700\u9ad8\u7684\u54e1\u5de5\u59d3\u540d\u53ca\u5de5\u8cc7\u3002<\/li>\n<pre><code>SELECT name, salary FROM employees e1\n    WHERE salary = (SELECT MAX(salary) FROM employees e2 WHERE e1.department = e2.department);<\/code><\/pre>\n<li><strong>\u984c\u76ee 2\uff1a<\/strong>\u4f7f\u7528 JOIN \u67e5\u8a62\u54e1\u5de5\u53ca\u5176\u6240\u5c6c\u90e8\u9580\u7684\u540d\u7a31\u3002<\/li>\n<pre><code>SELECT e.name, d.department_name FROM employees e\n    JOIN departments d ON e.department_id = d.department_id;<\/code><\/pre>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-XiIPZAExIw\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u7684\u7df4\u7fd2\u984c\uff0c\u5b78\u7fd2\u8005\u53ef\u4ee5\u66f4\u597d\u5730\u638c\u63e1 Oracle 10g \u6578\u64da\u5eab\u7684\u57fa\u672c\u64cd\u4f5c\u3001\u8a2d\u8a08\u539f\u5247\u53ca\u6027\u80fd\u512a\u5316\u6280\u5de7\u3002\u9019\u4e9b\u77e5\u8b58\u5c0d\u65bc\u672a\u4f86\u7684\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u4f5c\u81f3\u95dc\u91cd\u8981\u3002\u5982\u679c\u60a8\u5c0d\u65bc\u6578\u64da\u5eab\u7684\u904b\u884c\u74b0\u5883\u6709\u9032\u4e00\u6b65\u7684\u9700\u6c42\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u642d\u5efa\u60a8\u7684\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u548c\u9ad8\u6548\u7684\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Explore a collection of Oracle 10g database practice questions to enhance your skills and prepare for certification exams effectively.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-93764","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/93764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=93764"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/93764\/revisions"}],"predecessor-version":[{"id":93765,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/93764\/revisions\/93765"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=93764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=93764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=93764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}