版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
适用范 测试用 基本功能测 基表管 内置函 数据对象管 多源数据库支 数据库管 ORACLE兼容 易用性测 安装管理界面一致 图形化管理工 联机手册和帮助文 归档日志管 多实例管 字符集标准符合 可靠性测 备份恢 HA双机热 性能测 接口程序写入性 数据入库性能(JDBC和 数据检索性 TPC-C基 适用范测试用基本功能测基表管测试用例名称测试用例标测试用例说明(目的(bittimezone,前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提交事测试执行步序号测试输预期结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备注清除测试环境:droptable测SQL>createtabletab_01(c1int,c2char(10),c3varchar(1000),c4numeric(5,2),c5试c6bigint,c7tinyint,c8binary(1),c9float,c10doublePRECISION,c11real,c12bit,c13结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测试用例名测试用例标测试用例说(方的创建包含自增列的表,获取自增列当前值、、增前置条务测试执行步序测试输预期结1createtableTAB_03(c1bigserial,c2insertintoTAB_03(c2)values('a');insertintoTAB_03(c2)values('b');select*fromTAB_03; 清除测试环境:droptable试结SQL>createtableTAB_03(c1bigserial,c2NOTICE,系统默认动作,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测试用例名测试用例标测试用例说(方前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提交务测试执行步序号测试输预期结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)最后一句执行失败,唯一性T_CON_PKPRIMARY束;其他语句执行INSERTINTOTAB_12INSERTINTOTAB_12--ALTERTABLETAB_12DISABLECONSTRAINTINSERTINTOTAB_12deletefrom"TAB_12"wheretab_12id=ALTERTABLETAB_12ENABLECONSTRAINTINSERTINTOTAB_129createtableTAB_13(c1int,c2char(10)所有语句执行成功;查询返回结果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,系统默认动作,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的数 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启用约束(启用约束前先删除重复数据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)前置条务测试执行步序测试输预期结1SELECT查询结果为测试结SQL>SELECT果及截图(1测试用例名测试用例标测试用例说(方的CHARn前置条务测试执行步序测试输预期结1 BC测试结果及截SQL>SELECTCHAR(66),CHAR(67),CHAR(68);CHR|CHR|CHRB|C |D(1row)测试用例名测试用例标测试用例说(方的CHAR_LENGTHchar前置条务测试执行步序测试输预期结1SELECTCHAR_LENGTH('查询结果为测试SQLSELECTCHAR_LENGTH('我们结果及截图2测试用例名测试用例标测试用例说(方的DIFFERENCE(char1,char2)SOUNDEX前置条务测试执行步序测试输预期结1 DIFFERENCE('she',查询结果为测试结果SQL>SELECTDIFFERENCE('she',及截3(1测试用例名测试用例标测试用例说(方的将字符串char1从 的位置开始删除n2个字符,并将char2插入 n1前置条务测试执行步序测试输预期结1SELECTINSERT_TEXT('Thatisacake',2,3,a测试结果及截SQL>SELECTINSERT_TEXT('Thatisacake',2,3,'his');Thisisacake(1row)测试用例名测试用例标测试用例说(方的LCASE前置条务测试执行步序测试输预期结1SELECT查询结果为测试结果及截SQL>SELECTLCASE('ABC');(1测试用例名测试用例标测试用例说(方LEFT(char,n)n前置条务测试执行步序测试输预期结1 LEFT('computer查询结果为:computer测试SQL>SELECTLEFT('computerscience',10);computers(1row)测试用例名测试用例标测试用例说(方的LENGTH(char)返回给定字符串表达式的字符(而不是字节)前置条务测试执行步序测试输预期结1SELECTLENGTH('hi,查询结果为测试SQLSELECTLENGTH('hi,你好7(1测试用例名测试用例标测试用例说明(方法、目的测试函数LOCATE(char1,char2[,n])返回字符串char1在 中从位置nchar2的最左边前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提测试执行步序测试输预期结1SELECTLOCATE('man','Themanagerisaman',查询结果为2SELECTLOCATE('man','Themanagerisa查询结果为测试SQL>SELECTLOCATE('man','Themanagerisaman',10);(1SQL>SELECTLOCATE('man','Themanagerisaman');5(1测试用例名测试用例标测试用例说明(方法、目的POSITION(char1INchar2)/POSITION(char1,char2)char2串中第一次出现的char1的位置,如果char1是一个零长度的字符串,POSITION1char2char102前置条务测试执行步序测试输预期结1 POSITION('IN查询结果为测试SQLSELECTPOSITION('数IN国产数据库3(1测试用例名测试用例标测试用例说明(方法、目的REPEAT(char,n)REPEATSTR(char,n)n前置条登录;sql测试执行步序测试输预期结1SELECTREPEAT('oooo□测试SQL>SELECTREPEAT('ooo(1测试用例名测试用例标测试用例说明(方法、目的reverse(char)前置条登录;sql测试执行步序测试输预期结1SELECT测试SQL>SELECT(1测试用例名测试用例标测试用例说明(方法、目的RIGHT(char,n)/RIGHTSTR(char,n)n前置条务测试执行步序测试输预期结1select测试SQL>selectright('asdqwezxc',3);(1测试用例名测试用例标测试用例说明(方法、目的SPACE(n)n前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提测试执行步序测试输预期结1SELECT2 查询结果为:测试SQL>SELECT(1SQL>SELECTo(1测试用例名测试用例标测试用例说明(方法、目的OVERLAY(char1PLACINGchar2FROMm[FORn])(char1的指定子串,该子串是通过在源串中的给定起始位置的数值(m)和长度的数值(n)而指明,来修0时,不会从源串中移去任何串;当不nnchar2的长度。函数的返回串是在源串的给定起始前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提测试执行步序测试输预期结1SELECTOVERLAY('txxxxas'PLACING'hom'FROM2FOR测试SQL>SELECTOVERLAY('txxxxas'PLACING'hom'FROM2FOR4);(1测试用例名测试用例标测试用例说明(方法、目的TEXT_EQU(n1,n2)n1,n2tf。n1,n2CLOBTEXTLONGVARCHAR前置条数据库服务器已启动并以管理员登录;sql执行环境默认为自动提交务测试执行步序测试输预期结1 TEXTLIKE('a 'b2 TEXTLIKE('a','a测试SQL>selectTEXTLIKE('a','bf(1SQL>selectTEXTLIKE('a','at(1数值函测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结10SELECTCOS(0)"HyperboliccosineofHyperboliccosineof0测试SQL>SELECTCOS(0)"Hyperboliccosineof0";Hyperboliccosineof01测试用例名测试用例标测试用例说(方前置条务测试执行步序测试输预期结11.0SELECT测试SQL>SELECT(1测试用例名测试用例标测试用例说(方的eN前置条务测试执行步序测试输预期结1e4SELECTEXP(4)"etothe4th测试SQL>SELECTEXP(4)"etothe4thpower";etothe4thpower(1测试用例名测试用例标测试用例说(方的3前置条务测试执行步序测试输预期结11.2、3.4、2.1SELECT测试SQL>SELECTGREATEST(1.2,3.4,2.1);(1测试用例名测试用例标测试用例说(方的3前置条务测试执行步序测试输预期结11.2、3.4、2.1SELECT测试SQL>SELECTLEAST(1.2,3.4,2.1);(1测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结1createtabletest(idint,namechar(10),ageint);insertintotestvalues(1,'aa',23);insertintotestvalues(2,'bb',34);insertintotestvalues(3,'cc',12);insertintotest2Selectid,mod(age,10)fromID 清除测试环境: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前置条务测试执行步序测试输预期结1SELECTPOWER(3,2)2SELECTPOWER(-3,3)返回-测试SQL>SELECTPOWER(3,2)9(1SQL>SELECTPOWER(-3,3)(1测试用例名测试用例标测试用例说(方的01前置条务测试执行步序测试输预期结101SELECT查询结果为一个随机试结SQL>SELECT(1测试用例名测试用例标测试用例说(方的mnROUND(n前置条务测试执行步序测试输预期结1SELECT返回结果集2SELECT返回结果集3SELECTROUND(15.163,-返回结果集测试SQL>SELECTROUND(15.20);(1SQL>SELECTROUND(16.80);(1SQL>SELECTROUND(15.163,-1);(1测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结1SELECT返回结果集:测试SQL>SELECT(1测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结1SELECT测试SQL>SELECTTAN(0);(1测试用例名测试用例标测试用例说(方TO_CHARVARCHAR前置条务测试执行步序测试输预期结1SELECTTO_CHAR('01110'+查询结果为2SELECTTO_CHAR(-10000,'L99G999D99MI')测试SQL>SELECTTO_CHAR('01110'+(1SQL>SELECTTO_CHAR(-10000,'L99G999D99MI')(1日期时间函测试用例名测试用例标测试用例说(方的测试函数DATEADD(field,date,n)date加上相应天数n后的日期前置条物测试执行步序测试输预期结1SELECTDATEADD('DAy','2000-01-查询结果为:测试SQL>SELECTDATEADD('DAy','2000-01-(1测试用例名测试用例标测试用例说(方()前置条物测试执行步序测试输预期结1 测试SQL> (1测试用例名测试用例标测试用例说(方的CURTIME()TIMEWITHTIMEZONE前置条物测试执行步序测试输预期结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)前置条物测试执行步序测试输预期结1selectdateadd(day,2,'2013-1-31')from查询结果为:测试SQL>selectdateadd(day,2,'2013-1-31')from2013-02-02(1测试用例名测试用例标测试用例说(方的测试函数TIMESTAMPDIFF(datepart,date1,date2)返回跨两个指定日期的日期和时间边界数。datepart可以为YEAR(缩写YYYYYY)QUARTER(QQ或Q)MONTH(MM或M)DAYOFYEAR(DYY)DAY(DDD)WEEK(WK或WW)HOUR(HH)MINUTE(MIN)、SECOND(SSS)MILLISECOND(MS)前置条物测试执行步序测试输预期结1 查询结果为:-2SELECTTIMESTAMPDIFF('MONTH','2001-06-01',查询结果为3SELECTTIMESTAMPDIFF('WK',DATE'2003-02-查询结果为4 12:10:10.000','2003-02-14查询结果为:-测试(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测试用例名测试用例标测试用例说(方的测试函数DATEPART(datepart,date)返回代表日期的指定部分的整数。datepart可以为YEAR(缩写YY或YYYY)、QUARTER(缩写QQ或Q)、MONTH(MMM)、DAYOFYEAR(DYY)、DAY(DD或D)、MIN)、SECOND(SSS)MILLISECOND(MS)前置条物测试执行步序测试输预期结1SELECTDATEPART(SECOND,'2000-02-02查询结果为2SELECTDATEPART(DY,'2000-02-查询结果为3SELECTDATEPART(WEEKDAY,'2002-02-查询结果为测试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)前置条物测试执行步序测试输预期结1SELECTDAYNAME(DATE'2012-01-测试SQL>SELECTDAYNAME(DATE'2012-01-01');(1测试用例名测试用例标测试用例说(方的DAYOFMONTH(date)前置条物测试执行步序测试输预期结1SELECTDAYOFMONTH('2003-01-查询结果为测试SQL>SELECTDAYOFMONTH('2003-01-03');3(1测试用例名测试用例标测试用例说(方的DAYOFWEEK(date前置条物测试执行步序测试输预期结1SELECTDAYOFWEEK('2003-01-查询结果为测试SQL>SELECTDAYOFWEEK('2003-01-4(1测试用例名测试用例标测试用例说(方的DAYOFYEAR(date)前置条物测试执行步序测试输预期结1SELECTDAYOFYEAR('2003-03-查询结果为测试SQL>SELECTDAYOFYEAR('2003-03-(1测试用例名测试用例标测试用例说(方的CURTIMESTAMP()前置条物测试执行步序测试输预期结1SELECT如:2015-12-测试SQL>SELECT(1测试用例名测试用例标测试用例说明(方法、目的HOUR(time)前置条物测试执行步序测试输预期结1SELECTHOUR(TIME测试SQL>SELECTHOUR(TIME(1测试用例名测试用例标测试用例说明(方法、目的LEAST(n1,n2,n3)n1、n2和n3前置条测试执行步序测试输预期结1查询结果:测试SQL>(1测试用例名测试用例标测试用例说明(方法、目的MINUTE(time)前置条测试执行步序测试输预期结1SELECT测试SQL>SELECT(1测试用例名测试用例标测试用例说明(方法、目的MONTH(date)前置条测试执行步序测试输预期结1SELECTMONTH('2002-11-测试SQL>SELECTMONTH('2002-11-12');(1测试用例名测试用例标测试用例说明(方法、目的MONTHNAME(date)前置条物测试执行步序测试输预期结1SELECTMONTHNAME('2002-11-测试SQL>SELECTMONTHNAME('2002-11-(1测试用例名测试用例标测试用例说明(方法、目的MONTHS_BETWEEN(date1,date2)date1date2前置条物测试执行步序测试输预期结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()前置条测试执行步序测试输预期结1SELECT返回系统的当前日期时间,如:测试SQL>SELECT(1测试用例名测试用例标测试用例说明(方法、目的前置条测试执行步序测试输预期结1SELECTQUARTER('2002-08-3测试SQL>SELECTQUARTER('2002-08-3(1测试用例名测试用例标测试用例说明(方法、目的SECOND(time)前置条测试执行步序测试输预期结1SELECT测试SQL>SELECT(1测试用例名测试用例标测试用例说明(方法、目的TIMESTAMPADD(interval,n,timestamp)返回时间timestampnintervalfield09用text型的来指定interval值范围0:微秒1:秒2:3:4:5:6:7:8:9:前置条物测试执行步序测试输预期结12测试SQL>SELECTTIMESTAMPADD(4,40,'2002-12-012003-01-10(1SQL>SELECTTIMESTAMPADD(5,1,'2002-01-2002-02-06(1测试用例名测试用例标测试用例说明(方法、目的测试函数TIMESTAMPDIFF(interval,timestamp1,timestamp2)返回一个表明timestamp2timestamp1interval类型的时间间隔的整数。interval值范围,0:1:2:3:4:5:6:7:8:年9:前置条物测试执行步序测试输预期结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)前置条测试执行步序测试输预期结16测试SQL>SELECTWEEK(DATE'2003-02-6(1测试用例名测试用例标测试用例说明(方法、目的DAYOFWEEK(date)前置条测试执行步序测试输预期结1测试SQL>SELECTDAYOFWEEK(DATE'1998-10-2(1测试用例名测试用例标测试用例说明(方法、目的YEAR(date)前置条物测试执行步序测试输预期结1测试SQL>SELECTYEAR(DATE'2001-05-(1测试用例名测试用例标测试用例说明(方法、目的测试函数OVERLAPStime,time1,time2,time3)叠前置条物测试执行步序测试输预期结1SELECTf测试SQL>f(1测试用例名测试用例标测试用例说明(方法、目的SYSDATE()TIMESTAMPWITHTIMEZONE前置条物测试执行步序测试输预期结1SELECTSYSDATE1000测试SQL>SELECTSYSDATE2017-06-17(1集合函测试用例名测试用例标测试用例说明(法、目的前置条测试执行步序测试输预期结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清除测试环境: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测试用例名测试用例标(方法、目的前置条测试执行步序测试输预期结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清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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 清除测试环境: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前置条务测试执行步序测试输预期结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 清除测试环境: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前置条务测试执行步序测试输预期结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 清除测试环境: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前置条务测试执行步序测试输预期结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 清除测试环境: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前置条务测试执行步序测试输预期结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 清除测试环境: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前置条务测试执行步序测试输预期结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 清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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 清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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 清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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 清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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 清除测试环境: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测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结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; 清除测试环境: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前置条数据库服务器已启动并以管理员登录测试执行步序测试输预期结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数据对象管视图管测试用例名测试用例标测试用例说(方的前置条务测试执行步序测试输预期结1--createtablestudent(idint,namehouse_placevarchar(100),clainsertintostudentvalues(10001张','1-3');insertint
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年度别墅项目推广合作合同2篇
- 二手手机转让协议书(2024版)3篇
- 2024年度砂石料供货及运输合同范本2篇
- 2024年度货物供应合同协议及质量要求说明2篇
- 2024年度机械制造用钢材订购合同5篇
- 2024年度保险合同标的商铺租赁保险责任的认定与赔偿2篇
- 2024年高纯金属及氧化物项目资金需求报告
- 2024年度农业技术与农产品采购合同3篇
- 二零二四年度建筑项目设计与施工总承包合同2篇
- 2024年度融资租赁合同:飞机租赁及购买协议3篇
- 合格供货方档案表
- 我国机电产品出口的优势与问题
- 市政工程技术专业分析报告(共18页)
- 精益管理推行工作考评细则
- 养成好习惯教案
- 放射科质控总结
- 如何提取关键词
- 村集体经济组织年度财务收支预算表
- 案例思念休闲吧
- SBAR标准化沟通
- 正确认识疼痛ppt课件
评论
0/150
提交评论