毛片在线视频观看,一级日韩免费大片,在线网站黄色,澳门在线高清一级毛片

薈聚奇文、博采眾長、見賢思齊
當(dāng)前位置:公文素材庫 > 計(jì)劃總結(jié) > 工作總結(jié) > oracle復(fù)習(xí)總結(jié)

oracle復(fù)習(xí)總結(jié)

網(wǎng)站:公文素材庫 | 時(shí)間:2019-05-29 07:03:48 | 移動(dòng)端:oracle復(fù)習(xí)總結(jié)

oracle復(fù)習(xí)總結(jié)

一、

1.儲(chǔ)存模式是一種包含了諸如段。視圖。過程。函數(shù)程序包。觸發(fā)器。用戶自定義的對象集合類型序列同義詞和數(shù)據(jù)連接對象的邏輯結(jié)構(gòu)。2.用戶角色,對象權(quán)限系統(tǒng)權(quán)限

Select,insert,update,delete可以使用的權(quán)限是execute二.SQL語言

1.創(chuàng)建表createtable表名2.約束

(1)非空約束notnull(2)唯一約束unique

(3)主鍵約束primarykey最多只能有一個(gè)主鍵約束主鍵約束可以使用一列組成,不能有重復(fù)的不能為空

(4)外鍵約束foreignkey

外鍵是指引用一個(gè)表中的某個(gè)列或某幾個(gè)列,或本表中另一個(gè)列或者幾個(gè)列被引用的列應(yīng)該是主鍵列或者唯一性約束列。

約束關(guān)鍵詞constraint名稱foreignkeyreferences引用表名引用表主鍵(5)檢查約束checkconstraint名稱check表達(dá)式(6)缺省約束default3.修改表(1)增加列

Altertable表名add新列名數(shù)據(jù)類型(2)更新列

Altertable表名modify列名數(shù)據(jù)類型(3)刪除列

Altertable表名dropcolumn要?jiǎng)h除的列名(4)刪除表Droptable表名2.DML

1.檢索所有列Select*fromemp

Selectename,jobfromemp;

Selectename,to_char(hiredate,yyyy-mm-dd)fromempSelectdistinctdeptno,jobfromemp取消重復(fù)行Selectename,sal*12frommep處理null

Selectename,sal,comm.,(sal+comm)fromemp連接字符串

Selectename||isa||jobas”employdetail”fromemp使用簡單where子句

Selectename,salfromempwheresal>201*

Selectjob,salfromempwhereename=SCOTT;

Selectjob,salfromempwherelower(ename)=scott;

Where子句和betweenand

Selectename,sal,hiredate,jobfromempwheresalbetween1000and201*Where子句中使用like操作符

Selectename,salfromempwhereenamelikeS%;Orderby子句

1,升序排列

Selectename,salfromempwheredeptno=30orderbysal;2.降序排列

Selectename,sal,comm.Fromempwheredeptno=30orderbysaldesc3.使用多列排序

Selectename,sal,commmfromempwheredeptno=30orderbysalasc,comm.Desc4.數(shù)據(jù)分組Gropby1,分組函數(shù)

Selectmax(sal),min(sal)fromemp2,取消重復(fù)值

Selectcount(distinctdeptno)asdistinct_deptfrommep3.groupbyhaving子句

Selectcolumn,group_functionfrom表名whereconditiongroupbygroupby_expressionhavinggroup_condition

使用groupby進(jìn)行單列分組selectdeptno,avg(sal),mac(sal)fromempgroupbydeptno使用groupby進(jìn)行多列分組

Selectdeptno,job,avg(sal),max(sal)fromempgroupbydeptno,job;

使用having子句限制分組顯示selectdeptno,avg(sal),max(sal)fromempgroupbydeptnohavingavg(sal)ename=SMITH)成對比較

Selectename,sal,comm.,deptnofromempwhere(sal,nvl(comm.,-1))in(selectsal,nvl(comm.,-1)fromempwheredeptno=30)4.合并查詢

Union并集走掉結(jié)果集中的重復(fù)行unionall兩個(gè)結(jié)果記的并集不會(huì)取消重復(fù)行intersect兩個(gè)結(jié)果集的交集minus兩個(gè)結(jié)果集的差集Insert

(1)插入單行數(shù)insertintotablecolumn1coulmn2valuesvalues1values2

不使用列插入單行數(shù)據(jù)

Insertintodeptvalues(50,TRAINBOSTON)使用列插入單行數(shù)據(jù)

Insertintoemp(emp,ename,jobhiredate)values(1244,john,clerk,01-3-86)使用子查詢插入數(shù)據(jù)

Insertintoemployee(empno,ename,sal,deptno)selectempno,enmae,sal,deptnofromempwheredeptno=20使用first

Selectfirstwhendeptno=10thenintodept10whendeptno=20thenintodept20elseintootherselect*fromemp555update2.3事務(wù)鎖

事務(wù)用于確保數(shù)據(jù)庫的一致性主要由insertupdatedeleteselect。。。。forupdate提交事務(wù)commit回退事務(wù)rollback三.?dāng)?shù)據(jù)庫對象1,同義詞

Createsynonym名字forobject_name2序列創(chuàng)建序列

Createsequence名字Startwith名字incrementby數(shù)字(初始值)maxvalue數(shù)字cycle和nocycle使用序列

Selects_test.nextvalfromdualSelects_test.currvalformdual使用序列填充主鍵Creaetetablestudent(

Idintegerconstraints_testprimarykey,Namevarchar2(20);

Insertintostudent(id,name)values(s_test.nextval,fendou)3.視圖

1.視點(diǎn)集2.簡化操作3.定制數(shù)據(jù)4.合并分割數(shù)據(jù)5.安全性4.創(chuàng)建并使用視圖

Createorreplaceviewview_nameassubqueryconstranintconstraint_name

Createviewemp_viewasselectempno,ename,deptnofromempwheredeptno=30Insertintoemp_viewvalues(201*,fendou,30)創(chuàng)建具有checkoption約束的視圖Creaeteorreplaceemp_viewasselectempno,ename,deptnofromempwheredeptno=30wiehcheckoptionconstraintemp_view_ck5.索引

索引加快數(shù)據(jù)的一種有效方式

Creaeteuniqueindexindex_nameontable_namecolumn_name(column_name…)Tablespacetablespace_name

Createindexi_emp_indexonemp(deptno)

Createendexi_emp_ednoonemp(empno,deptno)修改索引

Alterindexi_emp_ednorenametoi_emp_noDropindexi_emp_no;臨時(shí)表

Createglobaltemporary表名列類型Oncommitpreserverows會(huì)話中斷時(shí)Commit時(shí)

Createglobaltemporarytabletemp_test2(tempIdint)

Oncommitdeleterows;四.PLSQL編程簡介1,塊結(jié)構(gòu)Declare

名稱類型值Begin

執(zhí)行異常處理部分End

已知矩形面積和高求寬度DeclareV_widthint;V_heithtint:=2;V_areaint:=6;Begin

SetthewidtheaualtotheareadividedbytheheightV_width:=v_area/v_height;

Dbms_output.put_line(“v_width=”||v_width);Exception

Whenzero_dividethen

Dbms_output.put_line(divisonbyzero);End

2,變量和類型

Intvarchar2number條件邏輯

Ifthenelseelseifendif循環(huán)

While循環(huán)for循環(huán)簡單循環(huán)Loop

StatementsEndloop

While循環(huán)

友情提示:本文中關(guān)于《oracle復(fù)習(xí)總結(jié)》給出的范例僅供您參考拓展思維使用,oracle復(fù)習(xí)總結(jié):該篇文章建議您自主創(chuàng)作。

來源:網(wǎng)絡(luò)整理 免責(zé)聲明:本文僅限學(xué)習(xí)分享,如產(chǎn)生版權(quán)問題,請聯(lián)系我們及時(shí)刪除。


oracle復(fù)習(xí)總結(jié)》由互聯(lián)網(wǎng)用戶整理提供,轉(zhuǎn)載分享請保留原作者信息,謝謝!
鏈接地址:http://www.seogis.com/gongwen/671830.html
相關(guān)文章