版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
適用范 測試用 基本功能測 基表管 內(nèi)置函 數(shù)據(jù)對象管 多源數(shù)據(jù)庫支 數(shù)據(jù)庫管 ORACLE兼容 易用性測 安裝管理界面一致 圖形化管理工 聯(lián)機手冊和幫助文 歸檔日志管 多實例管 字符集標準符合 可靠性測 備份恢 HA雙機熱 性能測 接口程序?qū)懭胄?數(shù)據(jù)入庫性能(JDBC和 數(shù)據(jù)檢索性 TPC-C基 適用范測試用基本功能測基表管測試用例名稱測試用例標測試用例說明(目的(bittimezone,前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提交事測試執(zhí)行步序號測試輸預(yù)期結(jié)1createtabletab_01(c1int,c2char(10),c3varchar(1000),c4numeric(5,2),c5smallint,c6bigint,c7tinyint,c8binary(1),c9float,c10doublePRECISION,c11real,c12bit,c13date,c14time,c15timestamp,c16intervalyeartomonth,c17timewithtimezone,text,c19blob,c20blob,c212insertintotab_01values(1,'abcd','testdatatype','-123.45','-32768','- ',123,'0x1',5,7.8,9.1,null,'2012-12-24','2012-12-2107:59:59','15-08','19:59:59'testtext ','testclob3select*from備注清除測試環(huán)境:droptable測SQL>createtabletab_01(c1int,c2char(10),c3varchar(1000),c4numeric(5,2),c5試c6bigint,c7tinyint,c8binary(1),c9float,c10doublePRECISION,c11real,c12bit,c13結(jié)time,c15timestamp,c16intervalyearto c17timewithtimezone,c18果blob,c20blob,c21及截SQL>insertintotab_01values(1,'abcd','testdatatype','-123.45','-32768', ',圖 5,7.8,9.1,null,'2012-12-24','21:59:59','2012-12-2107:59:59','15-08',+02:03','testtextdata ','testclobdata 1SQL>select*fromC1 | C9|C10 |C12 +1| |testdatatype|-123.45|-32768| |123|0x01| |7.8 |2012-12-24|21:59:59|2012-12-2107:59:59 -0819:59:59+02:03|testtextdatatype| | |testclobdata(1SQL>droptableDROP測試用例名測試用例標測試用例說(方的創(chuàng)建包含自增列的表,獲取自增列當前值、、增前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtableTAB_03(c1bigserial,c2insertintoTAB_03(c2)values('a');insertintoTAB_03(c2)values('b');select*fromTAB_03; 清除測試環(huán)境:droptable試結(jié)SQL>createtableTAB_03(c1bigserial,c2NOTICE,系統(tǒng)默認動作,CREATETABLEwillcreateimplicitsequence'TAB_03_C1_SEQ'forSERIALcolumn'TAB_03.C1'SQL>insertintoTAB_03(c2)values('a'); 115394SQL>insertintoTAB_03(c2)values('b'); 1281474976726050SQL>select*fromTAB_03;C1|C2+1|2|(2SQL>droptableTAB_03;DROPTABLE測試用例名測試用例標測試用例說(方前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提交務(wù)測試執(zhí)行步序號測試輸預(yù)期結(jié)1insertintoTAB_05values(2,insertintoTAB_05values(2,insert語句報唯一性約束2select*from在管理工具中,可以看到表TAB_05的索引項中索引為唯3insertintoTAB_06values(2,在管理工具中可以看到表TAB_06的索引中索引為唯一聚4createtableTAB_07(c1intunique,c2insertintoTAB_07values(1,'a');insertintoTAB_07values(2,'b');createtableTAB_08(c1intreferencesTAB_07(c1),c2date);insertintoTAB_08values(1,'2012-10-insertintoTAB_08values(2,'2012-10-insertintoTAB_08values(3,'2012-10-insert語句插入被表中被列之外的值5createtableTAB_09(c1intunique,c2insertintoTAB_09values(1,insertintoTAB_09values(1,insert語句報唯一性約6insertintoTAB_10values(1,insertintoTAB_10values(21,insert語句報check約7insertintoTAB_11values(1,insertintoTAB_11(c2)values女最后一條insert語句 空8CREATETABLETAB_12(idNUMBER(5)最后一句執(zhí)行失敗,唯一性T_CON_PKPRIMARY束;其他語句執(zhí)行INSERTINTOTAB_12INSERTINTOTAB_12--ALTERTABLETAB_12DISABLECONSTRAINTINSERTINTOTAB_12deletefrom"TAB_12"wheretab_12id=ALTERTABLETAB_12ENABLECONSTRAINTINSERTINTOTAB_129createtableTAB_13(c1int,c2char(10)所有語句執(zhí)行成功;查詢返回結(jié)果insertintoTAB_13(c1)values(1);insertintoTAB_13values2男');select*from droptableTAB_05;droptableTAB_06;droptableTAB_07cascade;droptableTAB_08;droptableTAB_09;droptableTAB_10;droptableTAB_11;droptableTAB_12;table測試SQL>createtableTAB_05(c1intprimarykey,c2 SQL>insertintoTAB_05values(2,'a'); 115538SQL>insertintoTAB_05values(2,ERROR,TAB_05_PKEYSQL>select*from"TAB_05";C1|C2+2|(1SQL>descColumn | |integer |notnull |character(1)|Indexes:TAB_05_PKEYPrimaryKeyBTREE(C1)PRIORITY0TABLESPACE"SYSTEM"LOGGINGINIT64KNEXT64KPCTINCREASE50FILL70SPLIT50VISIBLEOIDISSQL>createtableTAB_06(c1intprimarykey,c2char);CREATETABLESQL>insertintoTAB_06values(2,'a'); 115682SQL>descColumn | |integer |notnull |character(1)|Indexes:TAB_05_PKEYPrimaryKeyBTREE(C1)PRIORITY0TABLESPACE"SYSTEM"LOGGINGINIT64KNEXT64KPCTINCREASE50FILL70SPLIT50VISIBLEOIDISSQL>createtableTAB_07(c1intunique,c2char);CREATETABLESQL>insertintoTAB_07values(1,'a'); 115826SQL>insertintoTAB_07values(2,'b'); 1281474976726482SQL>createtableTAB_08(c1intreferencesTAB_07(c1),c2dateNOTICE,系統(tǒng)默認動作,CREATETABLEwillcreateimplicittrigger(s)forFOREIGNSQL>insertintoTAB_08values(1,'2012-10-21'); 115898SQL>insertintoTAB_08values(2,'2012-10-21'); 1281474976726554SQL>insertintoTAB_08values(3,'2012-10-ERROR,TAB_08_FKEYreferentialintegrityviolation-keyreferencedfromTAB_08notfoundinTAB_07SQL>createtableTAB_09(c1intunique,c2char);CREATETABLESQL>insertintoTAB_09values(1,'a'); 116042SQL>insertintoTAB_09values(1,ERROR,TAB_09_C1_KEYSQL>createtableTAB_10(c1intcheck(c1<20),c2char);CREATETABLESQL>insertintoTAB_10values(1,'a'); 116114SQL>insertintoTAB_10values(21,ERROR,INSERT的數(shù) SQL>createtableTAB_11(c1intnotnull,c2char(10));CREATETABLESQL>insertintoTAB_11values(1,'a'); 116186SQLinsertintoTAB_11(c2)values(女ERROR,C1啟用/SQL>CREATETABLETAB_12(idNUMBER(5)CONSTRAINTT_CON_PKPRIMARYKEY);CREATETABLESQL>INSERTINTOTAB_12VALUES(1); 116546SQL>INSERTINTOTAB_12VALUES(2); 1281474976727202--SQL>ALTERTABLETAB_12DISABLECONSTRAINTT_CON_PK;ALTERTABLE 1562949953437858SQL啟用約束(啟用約束前先刪除重復(fù)數(shù)據(jù)SQL>deletefrom"TAB_12"whereid=1;DELETESQL>ALTERTABLETAB_12ENABLECONSTRAINTT_CON_PK;ALTERTABLESQL>INSERTINTOTAB_12ERROR,T_CON_PKSQLSQLcreatetableTAB_13(c1intc2char(10)default女');CREATETABLESQL>insertintoTAB_13(c1)values(1); 115298SQL>insertintoTAB_13values(2,'男'); 1281474976725954SQL>select*fromTAB_13; C1| +1|2|字符串測試用例名測試用例標測試用例說(方的BIT_LENGTH返回字符串的位(bit)前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT查詢結(jié)果為測試結(jié)SQL>SELECT果及截圖(1測試用例名測試用例標測試用例說(方的CHARn前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1 BC測試結(jié)果及截SQL>SELECTCHAR(66),CHAR(67),CHAR(68);CHR|CHR|CHRB|C |D(1row)測試用例名測試用例標測試用例說(方的CHAR_LENGTHchar前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTCHAR_LENGTH('查詢結(jié)果為測試SQLSELECTCHAR_LENGTH('我們結(jié)果及截圖2測試用例名測試用例標測試用例說(方的DIFFERENCE(char1,char2)SOUNDEX前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1 DIFFERENCE('she',查詢結(jié)果為測試結(jié)果SQL>SELECTDIFFERENCE('she',及截3(1測試用例名測試用例標測試用例說(方的將字符串char1從 的位置開始刪除n2個字符,并將char2插入 n1前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTINSERT_TEXT('Thatisacake',2,3,a測試結(jié)果及截SQL>SELECTINSERT_TEXT('Thatisacake',2,3,'his');Thisisacake(1row)測試用例名測試用例標測試用例說(方的LCASE前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT查詢結(jié)果為測試結(jié)果及截SQL>SELECTLCASE('ABC');(1測試用例名測試用例標測試用例說(方LEFT(char,n)n前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1 LEFT('computer查詢結(jié)果為:computer測試SQL>SELECTLEFT('computerscience',10);computers(1row)測試用例名測試用例標測試用例說(方的LENGTH(char)返回給定字符串表達式的字符(而不是字節(jié))前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTLENGTH('hi,查詢結(jié)果為測試SQLSELECTLENGTH('hi,你好7(1測試用例名測試用例標測試用例說明(方法、目的測試函數(shù)LOCATE(char1,char2[,n])返回字符串char1在 中從位置nchar2的最左邊前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTLOCATE('man','Themanagerisaman',查詢結(jié)果為2SELECTLOCATE('man','Themanagerisa查詢結(jié)果為測試SQL>SELECTLOCATE('man','Themanagerisaman',10);(1SQL>SELECTLOCATE('man','Themanagerisaman');5(1測試用例名測試用例標測試用例說明(方法、目的POSITION(char1INchar2)/POSITION(char1,char2)char2串中第一次出現(xiàn)的char1的位置,如果char1是一個零長度的字符串,POSITION1char2char102前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1 POSITION('IN查詢結(jié)果為測試SQLSELECTPOSITION('數(shù)IN國產(chǎn)數(shù)據(jù)庫3(1測試用例名測試用例標測試用例說明(方法、目的REPEAT(char,n)REPEATSTR(char,n)n前置條登錄;sql測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTREPEAT('oooo□測試SQL>SELECTREPEAT('ooo(1測試用例名測試用例標測試用例說明(方法、目的reverse(char)前置條登錄;sql測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT測試SQL>SELECT(1測試用例名測試用例標測試用例說明(方法、目的RIGHT(char,n)/RIGHTSTR(char,n)n前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1select測試SQL>selectright('asdqwezxc',3);(1測試用例名測試用例標測試用例說明(方法、目的SPACE(n)n前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT2 查詢結(jié)果為:測試SQL>SELECT(1SQL>SELECTo(1測試用例名測試用例標測試用例說明(方法、目的OVERLAY(char1PLACINGchar2FROMm[FORn])(char1的指定子串,該子串是通過在源串中的給定起始位置的數(shù)值(m)和長度的數(shù)值(n)而指明,來修0時,不會從源串中移去任何串;當不nnchar2的長度。函數(shù)的返回串是在源串的給定起始前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTOVERLAY('txxxxas'PLACING'hom'FROM2FOR測試SQL>SELECTOVERLAY('txxxxas'PLACING'hom'FROM2FOR4);(1測試用例名測試用例標測試用例說明(方法、目的TEXT_EQU(n1,n2)n1,n2tf。n1,n2CLOBTEXTLONGVARCHAR前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄;sql執(zhí)行環(huán)境默認為自動提交務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1 TEXTLIKE('a 'b2 TEXTLIKE('a','a測試SQL>selectTEXTLIKE('a','bf(1SQL>selectTEXTLIKE('a','at(1數(shù)值函測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)10SELECTCOS(0)"HyperboliccosineofHyperboliccosineof0測試SQL>SELECTCOS(0)"Hyperboliccosineof0";Hyperboliccosineof01測試用例名測試用例標測試用例說(方前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)11.0SELECT測試SQL>SELECT(1測試用例名測試用例標測試用例說(方的eN前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1e4SELECTEXP(4)"etothe4th測試SQL>SELECTEXP(4)"etothe4thpower";etothe4thpower(1測試用例名測試用例標測試用例說(方的3前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)11.2、3.4、2.1SELECT測試SQL>SELECTGREATEST(1.2,3.4,2.1);(1測試用例名測試用例標測試用例說(方的3前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)11.2、3.4、2.1SELECT測試SQL>SELECTLEAST(1.2,3.4,2.1);(1測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(3,'cc',12);insertintotest2Selectid,mod(age,10)fromID 清除測試環(huán)境:droptable測試SQL>createtabletest(idint,namechar(10),ageCREATESQL>insertintotestvalues(1,'aa',23);INSERT115226SQL>insertintotestvalues(2,'bb',34);INSERT1281474976725882SQL>insertintotestvalues(3,'cc',12);INSERT1562949953436538SQL>insertintotestvalues(4,'dd',65);INSERT1844424930147194SQL>Selectid,mod(age,10)fromtest;ID|MOD+1|2|3|4|(4SQL>droptabletest;DROPTABLE測試用例名測試用例標測試用例說(方的POWER(m,n)mn前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTPOWER(3,2)2SELECTPOWER(-3,3)返回-測試SQL>SELECTPOWER(3,2)9(1SQL>SELECTPOWER(-3,3)(1測試用例名測試用例標測試用例說(方的01前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)101SELECT查詢結(jié)果為一個隨機試結(jié)SQL>SELECT(1測試用例名測試用例標測試用例說(方的mnROUND(n前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT返回結(jié)果集2SELECT返回結(jié)果集3SELECTROUND(15.163,-返回結(jié)果集測試SQL>SELECTROUND(15.20);(1SQL>SELECTROUND(16.80);(1SQL>SELECTROUND(15.163,-1);(1測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT返回結(jié)果集:測試SQL>SELECT(1測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT測試SQL>SELECTTAN(0);(1測試用例名測試用例標測試用例說(方TO_CHARVARCHAR前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTTO_CHAR('01110'+查詢結(jié)果為2SELECTTO_CHAR(-10000,'L99G999D99MI')測試SQL>SELECTTO_CHAR('01110'+(1SQL>SELECTTO_CHAR(-10000,'L99G999D99MI')(1日期時間函測試用例名測試用例標測試用例說(方的測試函數(shù)DATEADD(field,date,n)date加上相應(yīng)天數(shù)n后的日期前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDATEADD('DAy','2000-01-查詢結(jié)果為:測試SQL>SELECTDATEADD('DAy','2000-01-(1測試用例名測試用例標測試用例說(方()前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1 測試SQL> (1測試用例名測試用例標測試用例說(方的CURTIME()TIMEWITHTIMEZONE前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1 測試SQL>SELECT(1測試用例名測試用例標測試用例說(方的DATEADD(datepart,n,date)datendateparttimestamp值。datepartYEAR(YY或YYYY)、QUARTER(QQQ)、MONTH(MM或M)、DAYOFYEAR(DYY)DAY(DDD)WEEK(WK或WW)HOUR(HH)MINUTE(MIN)、SECOND(SSS)MILLISECOND(MS)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1selectdateadd(day,2,'2013-1-31')from查詢結(jié)果為:測試SQL>selectdateadd(day,2,'2013-1-31')from2013-02-02(1測試用例名測試用例標測試用例說(方的測試函數(shù)TIMESTAMPDIFF(datepart,date1,date2)返回跨兩個指定日期的日期和時間邊界數(shù)。datepart可以為YEAR(縮寫YYYYYY)QUARTER(QQ或Q)MONTH(MM或M)DAYOFYEAR(DYY)DAY(DDD)WEEK(WK或WW)HOUR(HH)MINUTE(MIN)、SECOND(SSS)MILLISECOND(MS)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1 查詢結(jié)果為:-2SELECTTIMESTAMPDIFF('MONTH','2001-06-01',查詢結(jié)果為3SELECTTIMESTAMPDIFF('WK',DATE'2003-02-查詢結(jié)果為4 12:10:10.000','2003-02-14查詢結(jié)果為:-測試(1SQL>SELECTTIMESTAMPDIFF('MONTH','2001-06-01',DATE7(1SQL>SELECTTIMESTAMPDIFF('WK',DATE'2003-02-07',DATE1(1SQL>SELECTTIMESTAMPDIFF('MS','2003-02-1412:10:10.000','2003-02-1412:09:09.300');(1測試用例名測試用例標測試用例說(方的測試函數(shù)DATEPART(datepart,date)返回代表日期的指定部分的整數(shù)。datepart可以為YEAR(縮寫YY或YYYY)、QUARTER(縮寫QQ或Q)、MONTH(MMM)、DAYOFYEAR(DYY)、DAY(DD或D)、MIN)、SECOND(SSS)MILLISECOND(MS)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDATEPART(SECOND,'2000-02-02查詢結(jié)果為2SELECTDATEPART(DY,'2000-02-查詢結(jié)果為3SELECTDATEPART(WEEKDAY,'2002-02-查詢結(jié)果為測試SQL>SELECTDATEPART(SECOND,'2000-02-0213:33:40.00');(1SQL>SELECTDATEPART(DY,'2000-02-02');(1SQL>SELECTDATEPART(WEEKDAY,'2002-02-02');6(1測試用例名測試用例標測試用例說(方的DAYNAME(date)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDAYNAME(DATE'2012-01-測試SQL>SELECTDAYNAME(DATE'2012-01-01');(1測試用例名測試用例標測試用例說(方的DAYOFMONTH(date)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDAYOFMONTH('2003-01-查詢結(jié)果為測試SQL>SELECTDAYOFMONTH('2003-01-03');3(1測試用例名測試用例標測試用例說(方的DAYOFWEEK(date前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDAYOFWEEK('2003-01-查詢結(jié)果為測試SQL>SELECTDAYOFWEEK('2003-01-4(1測試用例名測試用例標測試用例說(方的DAYOFYEAR(date)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTDAYOFYEAR('2003-03-查詢結(jié)果為測試SQL>SELECTDAYOFYEAR('2003-03-(1測試用例名測試用例標測試用例說(方的CURTIMESTAMP()前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT如:2015-12-測試SQL>SELECT(1測試用例名測試用例標測試用例說明(方法、目的HOUR(time)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTHOUR(TIME測試SQL>SELECTHOUR(TIME(1測試用例名測試用例標測試用例說明(方法、目的LEAST(n1,n2,n3)n1、n2和n3前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1查詢結(jié)果:測試SQL>(1測試用例名測試用例標測試用例說明(方法、目的MINUTE(time)前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT測試SQL>SELECT(1測試用例名測試用例標測試用例說明(方法、目的MONTH(date)前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTMONTH('2002-11-測試SQL>SELECTMONTH('2002-11-12');(1測試用例名測試用例標測試用例說明(方法、目的MONTHNAME(date)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTMONTHNAME('2002-11-測試SQL>SELECTMONTHNAME('2002-11-(1測試用例名測試用例標測試用例說明(方法、目的MONTHS_BETWEEN(date1,date2)date1date2前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTMONTHS_BETWEEN(DATE'1995-02-28',DATE'1995-01-2 TIMESTAMP'1995-01-3112:00:00')測試SQL>SELECTMONTHS_BETWEEN(DATE'1995-02-28',DATE'1995-01-(1SQL>SELECTMONTHS_BETWEEN(TIMESTAMP'1995-03-28TIMESTAMP'1995-01-3112:00:00')(1測試用例名測試用例標測試用例說明(方法、目的NOW()GETDATE()前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT返回系統(tǒng)的當前日期時間,如:測試SQL>SELECT(1測試用例名測試用例標測試用例說明(方法、目的前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTQUARTER('2002-08-3測試SQL>SELECTQUARTER('2002-08-3(1測試用例名測試用例標測試用例說明(方法、目的SECOND(time)前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT測試SQL>SELECT(1測試用例名測試用例標測試用例說明(方法、目的TIMESTAMPADD(interval,n,timestamp)返回時間timestampnintervalfield09用text型的來指定interval值范圍0:微秒1:秒2:3:4:5:6:7:8:9:前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)12測試SQL>SELECTTIMESTAMPADD(4,40,'2002-12-012003-01-10(1SQL>SELECTTIMESTAMPADD(5,1,'2002-01-2002-02-06(1測試用例名測試用例標測試用例說明(方法、目的測試函數(shù)TIMESTAMPDIFF(interval,timestamp1,timestamp2)返回一個表明timestamp2timestamp1interval類型的時間間隔的整數(shù)。interval值范圍,0:1:2:3:4:5:6:7:8:年9:前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECT'2003-02-1412:10:10.000','2003-02-14-2為:-測試SQL>SELECT'2003-02-1412:10:10.000','2003-02-142>-(1SQL>SELECTTIMESTAMPDIFF(7,'2003-06-01',DATE'2002-01-(1row)測試用例名測試用例標測試用例說明(方法、目的WEEK(date)前置條測試執(zhí)行步序測試輸預(yù)期結(jié)16測試SQL>SELECTWEEK(DATE'2003-02-6(1測試用例名測試用例標測試用例說明(方法、目的DAYOFWEEK(date)前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1測試SQL>SELECTDAYOFWEEK(DATE'1998-10-2(1測試用例名測試用例標測試用例說明(方法、目的YEAR(date)前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1測試SQL>SELECTYEAR(DATE'2001-05-(1測試用例名測試用例標測試用例說明(方法、目的測試函數(shù)OVERLAPStime,time1,time2,time3)疊前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTf測試SQL>f(1測試用例名測試用例標測試用例說明(方法、目的SYSDATE()TIMESTAMPWITHTIMEZONE前置條物測試執(zhí)行步序測試輸預(yù)期結(jié)1SELECTSYSDATE1000測試SQL>SELECTSYSDATE2017-06-17(1集合函測試用例名測試用例標測試用例說明(法、目的前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1createtableTFun02(anumber,bvarchar2(10),cinsertintoTFun02values(1,'a',3);insertintoTFun02values(2,'a',2);insertintoTFun02values(1,'b',2);insertintoTFun02values(1,'b',3);insertintoTFun02values(2,'b',7);insertintoTFun02insertintoTFun022selectvariance(a)from 9清除測試環(huán)境:droptable測試SQLSQL>createtableTFun02(anumber,bvarchar2(10),cnumber);CREATETABLESQL>insertintoTFun02values(1,'a',3);INSERT115298SQL>insertintoTFun02values(2,'a',2);INSERT1281474976725954SQL>insertintoTFun02values(1,'b',2);INSERT1562949953436610SQL>insertintoTFun02values(1,'b',3);INSERT1844424930147266SQL>insertintoTFun02INSERTINSERT1SQL>insertintoTFun02values(3,'b',1);INSERT11407374883568578SQL>insertintoTFun02values(8,'c',4);INSERT11688849860279234SQL查詢aSQL>selectvariance(a)fromTFUN02;(1SQL>droptableTFun02;DROPTABLE測試用例名測試用例標(方法、目的前置條測試執(zhí)行步序測試輸預(yù)期結(jié)1droptablecreatetableTFun02(anumber,bvarchar2(10),cinsertintoTFun02values(1,'a',3);insertintoTFun02values(2,'a',2);insertintoTFun02values(1,'b',2);insertintoTFun02values(1,'b',3);insertintoTFun02values(2,'b',7);insertintoTFun02insertintoTFun022--查詢aselectstddev(a)from 3清除測試環(huán)境:droptable測試SQLSQL>createtableTFun02(anumber,bvarchar2(10),cCREATESQL>insertintoSQL>insertintoTFun02values(1,'a',3);INSERT115442SQL>insertintoTFun02values(2,'a',2);INSERT1281474976726098SQL>insertintoTFun02values(1,'b',2);INSERT1562949953436754SQL>insertintoTFun02values(1,'b',3);INSERT1844424930147410SQL>insertintoTFun02values(2,'b',7);INSERT11125899906858066SQL>insertintoTFun02values(3,'b',1);INSERT11407374883568722SQL>insertintoTFun02values(8,'c',4);INSERT11688849860279378SQL查詢aSQL>selectstddev(a)fromTFUN02;(1SQL>droptableTFun02;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestvalues(15,'ff',34);insertintotestinsertintotest2 MAX(id)OVER(PARTITIONBYage) MAXIDFROM AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageCREATESQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>SELECTage,name,MAX(id)OVER(PARTITIONBYASFROMAGE | 12| 23| 23| 34| 34| 55| 65| 77| (8SQL>droptabletest;DROPTABLE測試用例名COUNT測試用例標測試用例說(方的COUNT前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestvalues(15,'ff',34);insertintotestinsertintotest2 count(id)OVER(PARTITIONBYage) COUNTIDFROM AGE 清除測試環(huán)境:droptable測試SQL>createtabletest(idint,namechar(10),ageint);CREATETABLESQL>insertintotestvalues(1,'aa',23);INSERT116618SQL>insertintotestvalues(2,'bb',34);INSERT1281474976727274SQL>insertintotestvalues(4,'cc',12);INSERT1562949953437930SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>SELECTage,name,count(id)OVER(PARTITIONBYCOUNTIDFROMAGE | 12| 23| 23| 34| 34| 55| 65| 77| (8SQL>droptableDROP測試用例名MAX測試用例標測試用例說(方的MAX前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestinsertintotestinsertintotest2 MAX(id)OVER(PARTITIONBYage) MAXIDFROM AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageCREATESQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>SELECTage,name,MAX(id)OVER(PARTITIONBYASFROMAGE | 12| 23| 23| 34| 34| 55| 65| 77| (8rows)SQL>droptableDROP測試用例名MIN測試用例標測試用例說(方的MIN前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestvalues(15,'ff',34);insertintotestinsertintotest2 MIN(id)OVER(PARTITIONBYage) MINIDFROM AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageint);CREATETABLESQL>insertintotestvalues(1,'aa',23);INSERT116762SQL>insertintotestvalues(2,'bb',34);INSERT1281474976727418SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>SELECTage,name,MIN(id)OVER(PARTITIONBYASFROMAGE | 12| 23| 23| 34| 34| 55| 65| 77| (8SQL>droptableDROP測試用例名SUM測試用例標測試用例說(方的SUM前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestinsertintotestinsertintotestinsertintotest2 age,name,SUM(id)OVER(PARTITIONBYage)ASSUMIDFROMtest;AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageCREATESQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>SELECTage,name,SUM(id)OVER(PARTITIONBYage)ASFROMAGE | 12| 23| 23| 34| 34| 55| 65| 77| (8SQL>droptabletest;DROPTABLE測試用例名RANK測試用例標測試用例說(方的RANK前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestvalues(15,'ff',34);insertintotestinsertintotest2selectid,age,rank()over(orderbyage)asrankfrom AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageint);CREATETABLESQL>insertintotestvalues(1,'aa',23);INSERT116474SQL>insertintotestINSERT1SQL>insertintotestvalues(4,'cc',12);INSERT1562949953437786SQL>insertintotestvalues(5,'dd',65);INSERT1844424930148442SQL>insertintotestvalues(8,'ee',55);INSERT11125899906859098SQL>insertintotestvalues(15,'ff',34);INSERT11407374883569754SQL>insertintotestvalues(25,'gg',77);INSERT11688849860280410SQL>insertintotestvalues(35,'hh',23);INSERT11970324836991066SQL>selectid,age,rank()over(orderbyage)asrankfromtest;ID|AGE|RANK 4|12 35|23 1|23 15|34 2|34 8|55 5|65 25|77 (8SQL>droptabletest;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestinsertintotestinsertintotestinsertintotest2selectid,age,DENSE_RANK()over(orderbyage)asrank AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageCREATESQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>insertintotestINSERT1SQL>selectid,age,DENSE_RANK()over(orderbyage)asrankID|AGE| 4|12 35|23 1|23 15|34 2|34 8|55 5|65 25|77 (8SQL>droptabletest;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(4,'cc',12);insertintotestvalues(5,'dd',65);insertintotestvalues(8,'ee',55);insertintotestvalues(15,'ff',34);insertintotestinsertintotest2selectid,age,ROW_NUMBER()over(orderbyage)asrankfrom AGE 清除測試環(huán)境:droptable測試SQLSQL>createtabletest(idint,namechar(10),ageint);CREATETABLESQL>insertintotestvalues(1,'aa',23);INSERT116330SQL>insertintotestvalues(2,'bb',34);INSERT1281474976726986SQL>insertintotestINSERT1SQL>insertintotestvalues(5,'dd',65);INSERT1844424930148298SQL>insertintotestvalues(8,'ee',55);INSERT11125899906858954SQL>insertintotestvalues(15,'ff',34);INSERT11407374883569610SQL>insertintotestvalues(25,'gg',77);INSERT11688849860280266SQL>insertintotestvalues(35,'hh',23);INSERT11970324836990922SQL>selectid,age,ROW_NUMBER()over(orderbyage)asrankfromID|AGE| 4|12 35|23 1|23 15|34 2|34 8|55 5|65 25|77 (8SQL>droptabletest;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1EMPNONUMBER(4,0)primarykey,ENAMEVARCHAR2(10), DEPTNO M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO)(7839,'KING',' M,DEPTNO) M,DEPTNO) M,DEPTNO) M,DEPTNO) 2selectmax(empno)keep(dense_rankfirstorderbymax(sal)maxsalfromTFun01groupby 清除測試環(huán)境:droptable測試SQL>CREATETABLE2> EMPNONUMBER(4,0)primary ENAME JOB MGR COMM DEPTNO10>CREATESQL>InsertintoTFun012>INSERT1SQL>InsertintoTFun012>INSERT1SQL>InsertintoTFun012>INSERT1SQL>InsertintoTFun012>INSERT1SQL>InsertintoTFun012>INSERT1SQL>InsertintoTFun01 2>INSERT1SQL>InsertintoTFun01 2>INSERT1SQL>InsertintoTFun01 2> INSERT1SQL>InsertintoTFun01 2> INSERT1SQL>InsertintoTFun01 2>INSERT1SQL>InsertintoTFun01 2>INSERT1SQL>InsertintoTFun01 2>INSERT1SQL>InsertintoTFun01 2> INSERT1SQL>InsertintoTFun01 2>INSERT13659174697254618SQL>select max(sal)maxsal from groupbydeptno;DEPTNO|EMPNO|MAXSAL 10|7934|20|7369|30|7900|(3SQL>droptableTFun01;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtableTFun05(anumber,bvarchar2(10),cnumber);insertintoTFun05values(1,'a',3);insertintoTFun05values(2,'a',2);insertintoTFun05values(1,'b',2);insertintoTFun05values(1,'b',3);insertintoTFun05values(2,'b',3);insertintoTFun05values(3,'b',7);insertintoTFun05insertintoTFun052selectt.*,lag(c,1)over(orderbya)lagfromTFun05 清除測試環(huán)境:droptable測試SQLSQL>createtableTFun05(anumber,bvarchar2(10),cnumber);CREATETABLESQL>insertintoTFun05INSERT1SQL>insertintoTFun05values(2,'a',2);INSERT1281474976726538SQL>insertintoTFun05values(1,'b',2);INSERT1562949953437194SQL>insertintoTFun05values(1,'b',3);INSERT1844424930147850SQL>insertintoTFun05values(2,'b',3);INSERT11125899906858506SQL>insertintoTFun05values(3,'b',7);INSERT11407374883569162SQL>insertintoTFun05values(3,'b',1);INSERT11688849860279818SQL>insertintoTFun05values(8,'c',4);INSERT11970324836990474SQL>selectt.*,lag(c,1)over(orderbya)lagfromTFun05t;A|B|C|LAG 1|b|31|a|3|1|b|2|2|a|2|2|b|3|3|b|7|3|b|1|8|c|4|(8SQL>droptableTFun05;DROPTABLE測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1createtableTFun06(id insertintoTFun06(ID,VAL,NUM)values(10,'abc',1);insertintoTFun06(ID,VAL,NUM)values(10,'abc',insertintoTFun06(ID,VAL,NUM)values(10,'def',insertintoTFun06(ID,VAL,NUM)values(10,'def',2SELECTID,WM_CONCAT(VAL)ASENAMESFROMTFun06GROUPBYIDORDERBYID; 清除測試環(huán)境:droptable測試SQLSQL>createtableTFun06(idnumber,valvarchar2(20),numCREATESQL>insertintoTFun06(ID,VAL,NUM)values(10,'abc',INSERT1SQL>insertintoTFun06(ID,VAL,NUM)values(10,'abc',INSERT1SQL>insertintoTFun06(ID,VAL,NUM)values(10,'def',INSERT1SQL>insertintoTFun06(ID,VAL,NUM)values(10,'def',INSERT1SQL>SELECTID,WM_CONCAT(VAL)ASENAMESFROMTFun06GROUPBYORDERBYID +10|(1SQL>droptableDROP邏輯函測試用例名測試用例標測試用例說(方的decode前置條數(shù)據(jù)庫服務(wù)器已啟動并以管理員登錄測試執(zhí)行步序測試輸預(yù)期結(jié)1droptablecreatetabletest(idint);insertintotestvalues(1);insertintotestvalues(2);insertintotestvalues(3);insertintotestinsertintotestinsertintotestvalues(6);insertintotestvalues(7);insertintotest2selectid,decode((id<5),true,'left','right')from測試SQL>droptableERROR,表不存在table"TESTdoesnotexistSQL>createtabletest(idint);CREATESQL>insertintotestvalues(1); 115738SQL>insertintotestvalues(2); 1SQL>insertintotestvalues(3); 1SQL>insertintotestvalues(4); 1SQL>insertintotestvalues(5); 1SQL>insertintotestvalues(6); 1SQL>insertintotestvalues(7); 1SQL>insertintotestvalues(8); 11970324836990330SQL>selectid,decode((id<5),true,'left','right')fromtest;ID|DECODE+||||||||(8數(shù)據(jù)對象管視圖管測試用例名測試用例標測試用例說(方的前置條務(wù)測試執(zhí)行步序測試輸預(yù)期結(jié)1--createtablestudent(idint,namehouse_placevarchar(100),clainsertintostudentvalues(10001張','1-3');insertint
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度珠寶首飾OEM定制加工合同范本2篇
- 二零二五版網(wǎng)絡(luò)安全設(shè)備采購合同3篇
- 二零二五版鋼琴經(jīng)銷商區(qū)域保護與市場拓展合同2篇
- 原材料卸車作業(yè)中最低效率保障合同3篇
- 二零二五年度綠色信貸反擔(dān)保保證合同規(guī)范范本3篇
- 基于2025年度戰(zhàn)略規(guī)劃的企業(yè)裁員和解雇合同3篇
- 二零二五版房屋買賣合同范本下載關(guān)注合同簽訂中的房產(chǎn)證注銷與手續(xù)辦理3篇
- 二零二五版汽車租賃合同押金退還協(xié)議書3篇
- 二零二五年度房產(chǎn)回購及社區(qū)公共設(shè)施建設(shè)合同3篇
- 二零二五版道路混凝土鋪設(shè)及維修合同3篇
- 第5課《弘揚勞動精神勞模精神工匠精神》第1框《理解勞動精神勞模精神工匠精神》-【中職專用】《職業(yè)道德與法治》同步課堂課件
- 2025美國國防部財年美軍武器裝備采購預(yù)算中文版
- 70歲換證三力測試題附答案
- 中華醫(yī)學(xué)會利益沖突聲明模板
- 帶你玩轉(zhuǎn)VR虛擬現(xiàn)實智慧樹知到期末考試答案2024年
- DAM10KW中波發(fā)射機各單元的檢測與調(diào)整指導(dǎo)示意圖
- 物業(yè)采購工作總結(jié)
- 人教版四年級上冊加減乘除四則混合運算300題及答案
- 組織文化與領(lǐng)導(dǎo)力
- 膠粘性不良改善報告
- 河北省石家莊市橋西區(qū)2023-2024學(xué)年九年級上冊期末英語模擬試題(附答案)
評論
0/150
提交評論