下载

3下载券

加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 《跟我学Java 26日通》第 4 天 Oracle高级应用

《跟我学Java 26日通》第 4 天 Oracle高级应用 .pdf

《跟我学Java 26日通》第 4 天 Oracle高级应用

bjchengzhimin
2009-10-21 0人阅读 举报 0 0 暂无简介

简介:本文档为《《跟我学Java 26日通》第 4 天 Oracle高级应用 pdf》,可适用于IT/计算机领域

OracleCREATETABLEOracle|VARCHAR()|NUMBER()MLDNMLDN|DATE|CLOB|BLOBCREATETABLEASALTERTABLEALTERTABLE|ALTERTABLEADD(DEFAULT)|ALTERTABLEMODIFY(DEFAULT)SQL|PRIMARYKEY|NOT|UNIQU|CHECK|FOREIGNKEY||Oracle|DROPTABLECASCADECONSTRAINT|ONDELETECASCADE|ALTERTABLEADDCONSTRAINT()|ALTERTABLEDROPCONSTRAINT|CONSTRAINTROWNUMSEQUENCEPowerDesignerCREATEVIEWASCREATEVIEWempvASSELECTempno,ename,job,hiredateFROMempWHEREdeptno=SELECT*FROMempvMLDNCREATEVIEWempvASSELECTempno,ename,job,sal,hiredateFROMempWHEREdeptno=DROPVIEWempvDROPVIEWempvCREATEVIEWempvASSELECTempno,ename,job,sal,hiredateFROMempWHEREdeptno=OracleMLDNCREATEORREPLACEASCREATEORREPLACEVIEWempvASSELECTempno,ename,job,sal,hiredateFROMempWHEREdeptno=SELECTddname,edc,eda,eenameFROMdeptd,(SELECTdeptno,COUNT(empno)c,AVG(sal)a,MIN(sal)minFROMempGROUPBYdeptno)ed,empeWHEREddeptno=eddeptnoANDesal=edminMLDNSQLCREATEORREPLACEVIEWmyempvASSELECTddname,edc,eda,eenameFROMdeptd,(SELECTdeptno,COUNT(empno)c,AVG(sal)a,MIN(sal)minFROMempGROUPBYdeptno)ed,empeWHEREddeptno=eddeptnoANDesal=edminSELECT*FROMmyempvCREATEORREPLACEVIEWempvASSELECT*FROMempWHEREdeptno=MLDNdeptno=UPDATEempvSETdeptno=WHEREempno=empSELECT*FROMempMLDNempSQLWITHCHECKOPTIONCREATEORREPLACEVIEWempvASSELECT*FROMempWHEREdeptno=WITHCHECKOPTIONUPDATEempvSETdeptno=WHEREempno=MLDNUPDATEempvSETename=''WHEREempno=WITHREADONLYCREATEORREPLACEVIEWempvASSELECT*FROMempWHEREdeptno=WITHREADONLYMLDNUPDATEempvSETename=''WHEREempno=OracleCREATESEQUENCEsequenceINCREMENTBYnSTARTWITHn{MAXVALUEn|NOMAXVALUE}{MINVALUEn|NOMINVALUE}{CYCLE|NOCYCLE}{CACHEn|NOCACHE}myseqCREATESEQUENCEmyseqnextValcurrValCREATETABLEtestseq(nextNUMBER,currNUMBER)MLDNINSERTINTOtestseq(next,curr)VALUES(myseqnextval,myseqcurrval)testseqSELECT*FROMtestseqnextvalcurrINCREMENTBYDROPSEQUENCEmyseqCREATESEQUENCEmyseqINCREMENTBYMLDNtestseqDROPTABLEtestseqCREATETABLEtestseq(nextNUMBER,currNUMBER)INSERTINTOtestseq(next,curr)VALUES(myseqnextval,myseqcurrval)STARTWITHDROPSEQUENCEmyseqCREATESEQUENCEmyseqINCREMENTBYSTARTWITHDROPSEQUENCEmyseqCREATESEQUENCEmyseqMAXVALUEINCREMENTBYSTARTWITHCACHECYCLEMLDNtestseqCREATESEQUENCESELECTSYSDATEFROMdualdualsystemsystemCONNsystemmanagerdualsysCONNsyschangeoninstallASSYSDBAMLDNsyssysscottCREATESYNONYMFORscottempempCREATESYNONYMempFORscottempDROPSYNONYMempDROPSYNONYMempOracleOracleCREATEUSERIDENTIFIEDBYtesttestCREATEUSERtestIDENTIFIEDBYtestsqlpluswERROR:ORA:userTESTlacksCREATESESSIONprivilegelogondeniedtestsessionsessionMLDNGRANT,,…TOSESSIONtestGRANTCREATESESSIONTOtesttestSESSIONtabCREATETABLEtab(idNUMBERPRIMARYKEYNOT,nameVARCHAR())OracleCONNECTRESOURCEtestGRANTCONNECT,RESOURCETOtesttestALTERUSERIDENTIFIYEDBYtesthelloALTERUSERtestIDENTIFIEDBYhelloALTERUSERPASSWORDEXPIREtestALTERUSERtestPASSWORDEXPIREMLDNALTERUSERACCOUNTLOCKtestALTERUSERtestACCOUNTLOCKUNLOCKALTERUSERACCOUNTUNLOCKtestALTERUSERtestACCOUNTUNLOCKtestscottscottempMLDNMLDNscottemptestGRANTSELECT,DELETEONscottempTOtestREVOKEREVOKEONFROMtestSELECTDELETEREVOKESELECT,DELETEONscottempFROMtestOracleexpimpddatad:dataimpdepartmentprojectCREATETABLEdepartment(deptnoNUMBER()PRIMARYKEYNOT,dnameVARCHAR()NOT)CREATETABLEproject(proidNUMBER()PRIMARYKEYNOT,pronameVARCHAR()NOT,prodateDATENOT,deptnoNUMBER(),CONSTRAINTdepartmentprojectdeptnoFOREIGNKEY(deptno)ONDELETECASCADE)OracledeparmentCREATETYPEprojecttyASOBJECT(proidNUMBER(),pronameVARCHAR(),prodateDATE)CREATETYPEprojectntASTABLEOFprojecttyprojectntprojecttyvarchardepartmentCREATETABLEdepartment(deptnoNUMBER()PRIMARYKEYNOT,dnameVARCHAR()NOT,projectsprojectnt)NESTEDTABLEprojectsSTOREASprojectnttabtempMLDNprojecttyINSERTINTOdepartment(deptno,dname,projects)VALUES(,'',projectnt(projectty(,'ERP',SYSDATE),projectty(,'CRM',SYSDATE),projectty(,'OA',SYSDATE)))SELECT*FROMdepartmentSELECT*FROMTABLE(SELECTprojectsFROMdepartmentWHEREdeptno=)MLDNUPDATETABLE(SELECTprojectsFROMdepartmentWHEREdeptno=)proSETVALUE(pro)=projectty('','',TODATE('','yyyymmdd'))WHEREproproid=CREATETYPEworkerinfoASOBJECT(idNUMBER,nameVARCHAR(),sexVARCHAR())MLDNCREATETYPEworkerinfolistASVARRAY()OFworkerinfoDROPTABLEdepartmentCREATETABLEdepartment(deptnoNUMBER()PRIMARYKEYNOT,dnameVARCHAR()NOT,workersworkerinfolist)MLDNINSERTINTOdepartment(deptno,dname,workers)VALUES(,'',workerinfolist(workerinfo(,'',''),workerinfo(,'',''),workerinfo(,'','')))SELECT*FROMdepartmentOraclescottCREATETABLEperson(pidNUMBER()PRIMARYKEYNOT,nameVARCHAR(),infoVARCHAR())MLDNMLDNINSERTINTOperson(pid,name,info)VALUES(,'','')CREATETABLEperson(pidNUMBER()PRIMARYKEYNOT,nameVARCHAR(),birthdayDATE,areaVARCHAR(),subareaVARCHAR(),addressVARCHAR())CREATETABLEperson(pidNUMBER()PRIMARYKEYNOT,VARCHAR(),VARCHAR(),birthdayDATE,areaVARCHAR(),subareaVARCHAR(),addressVARCHAR())CREATETABLEselectcourse(stunoVARCHAR(),stunameVARCHAR(),MLDNstuageNUMBER,cnameVARCHAR(),gradeNUMBER,creditNUBER)INSERTINTOselectcourseVALUES('s','',,'JAVA',,)INSERTINTOselectcourseVALUES('s','',,'JAVA',,)INSERTINTOselectcourseVALUES('s','',,'JAVA',,)CREATETABLEstudent(stunoVARCHAR()PRIMARYKEYNOT,stunameVARCHAR(),stuageNUMBER)CREATETABLEcourse(cidNUMBER()PRIMARYKYENOT,cnameVARCHAR(),creditNUBER)CREATETABLEselectcourse(stunoVARCHAR(),cidNUMBER(),gradeNUMBER,)INSERTINTOstudent(stuno,stuname,stuage)VALUES('s','',)INSERTINTOstudent(stuno,stuname,stuage)VALUES('s','',)INSERTINTOstudent(stuno,stuname,stuage)VALUES('s','',)MLDNINSERTINTOcourse(cid,cname,credit)VALUES('ca','JAVA',)INSERTINTOcourse(cid,cname,credit)VALUES('cb','Oracle',)INSERTINTOselectcourse(stuno,cid,grade)VALUES('s','ca',)INSERTINTOselectcourse(stuno,cid,grade)VALUES('s','ca',)INSERTINTOselectcourse(stuno,cid,grade)VALUES('s','ca',)CREATETABLEstudent(stunoVARCHAR()PRIMARYKEYNOT,stunameVARCHAR(),stuageNUMBER)CREATETABLEcollage(cidNUMBER()PRIMARYKEYNOT,cnameVARCHAR()NOT,caddressVARCHAR()NOT,ctelVARCHAR()NOT)CREATETABLEstudentcollage(stunoVARCHAR(),cidNUMBER(),)CREATETABLEcollage(cidNUMBER()PRIMARYKEYNOT,cnameVARCHAR()NOT,caddressVARCHAR()NOT,ctelVARCHAR()NOT)CREATETABLEstudent(stunoVARCHAR()PRIMARYKEYNOT,stunameVARCHAR(),stuageNUMBER,cidNUMBER(),)SQLSybasePowerDesignerOraclePowerDesignerOracledeptempMLDNNUMBER()VARCHAR()VARCHAR()<pk>NUMBER()VARCHAR()VARCHAR()NUMBER()DATENUMBER(,)NUMBER(,)NUMBER()<pk>defkNUMBER()VARCHAR()VARCHAR()<pk>NUMBER()VARCHAR()VARCHAR()NUMBER()DATENUMBER(,)NUMBER(,)NUMBER()<pk><fk>PowerDesignerMLDNpowerdesignerFKPRODUCTREFERENCEPRODUCTGNUMBERVARCHAR()VARCHAR()<pk>NUMBERVARCHAR()NUMBERNUMBERVARCHAR()NUMBERVARCHAR()<pk><fk>FKREFERENCEFKREFERENCEFKREFERENCEFKREFERENCENUMBERVARCHAR()VARCHAR()<pk>NUMBERVARCHAR()VARCHAR()<pk>VARCHAR()VARCHAR()VARCHAR()VARCHAR()<pk>VARCHAR()NUMBER<fk><fk>NUMBERNUMBER<fk><fk>MLDNFKPRODUCTREFERENCENUMBERVARCHAR()NUMBERNUMBERVARCHAR()NUMBERVARCHAR()<pk><fk><fk>VARCHAR()VARCHAR()VARCHAR()VARCHAR()<pk>FKREFERENCEFKREFERENCEFKREFERENCEFKREFERENCEFKREFERENCEemailVARCHAR()VARCHAR()VARCHAR()VARCHAR()DATENUMBERNUMBER<Undefined><pk><fk><fk>NUMBERVARCHAR()DATE<pk><fk>NUMBERNUMBERNUMBER<pk><fk><fk>NUMBERVARCHAR()<pk>NUMBERVARCHAR()NUMBER<pk><fk>OraclesalgradeNUMBERNUMBERNUMBER<pk>MLDNXxxXxxxxxXxxxxXxxxXxxxxxxXxxxxNoXxxxXxxxXxxxXxxxNUMBERVARCHAR()DATENUMBERVARCHAR()NUMBERVARCHAR()VARCHAR()VARCHAR()VARCHAR()<pk><fk><fk><fk>NUMBERNUMBERNUMBERVARCHAR()NUMBERNUMBER<pk><fk><fk>OracleOracleSQLROWNUMOracleMLDNMLDNcommitrollback

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/31

《跟我学Java 26日通》第 4 天 Oracle高级应用

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利