目前本站已有 十几万 份求职资料啦!


数据库oracle笔试

12-17 15:51:23 来源:http://www.qz26.com 笔试题目   阅读:8380
导读:1、 数据库中使用update修改多个字段值的问题经我在PL/SQL环境下调试,得出如下结论(scott/tiger 下的dept表):update dept set dname='yao', loc='shaoyang' where deptno=10; --通过update dept set(dname, loc)=('yao','shaoyang') where deptno=10; --错误update dept set(dname, loc)=(select dname,loc from dept where deptno=20) where deptno=10;--通过2、程序流程问题(题目略去, 如下为我的验证代码):public class TestCircle {public static void main(String[] args) {int i=2, j=9;do{if(i>j){break;}j--;}whil
数据库oracle笔试,标签:银行笔试题目,企业笔试题目,http://www.qz26.com

  1、 数据库中使用update修改多个字段值的问题

  经我在PL/SQL环境下调试,得出如下结论(scott/tiger 下的dept表):

  update dept set dname='yao', loc='shaoyang' where deptno=10; --通过

  update dept set(dname, loc)=('yao','shaoyang') where deptno=10; --错误

  update dept set(dname, loc)=(select dname,loc from dept where deptno=20) where deptno=10;--通过

  2、程序流程问题(题目略去, 如下为我的验证代码):

  public class TestCircle {

  public static void main(String[] args) {

  int i=2, j=9;

  do{

  if(i>j){

  break;

  }

  j--;

  }while(++i<5);

  System.out.println("i is: "+i+", j is: "+j);

  int k = new TestCircle().testCase(1);

  System.out.println("k is : "+k);

  }

  public int testCase(int n){

  int j=1;

  switch (n) {

  case 1: j++;

  case 2: j++;

  case 3: j++;

  case 4: j++;

  case 5: j++;

  System.out.println("j is : "+j);

  default: j++;

  }

  return n+j;

  }

  }

  testCase这个问题我做错了, 题目是要求最终打印出的k为8,请你给i与n赋值。

  我在考场上写的n=5, i=2; 运行得出结果却为9. 分析了一下得出原因在于: 如果n<5的话,那么它会从其自身起一直到5都会执行j++这条语句, 因为此代码片段中并没有使用 break。

  n与i有多种组合值, 如(1,1)、(4,1)和(5,1)等都可以。

  3、 复习 JAVA的 “内部类”章节。

  4、 复习 JAVA的 “反射”章节。

  5、 温习 操作系统 部分的知识。

  6、 数组问题:

  如我声明 int [] a = new int[1] , 那么a[0]的默认值就为0。 我起初理解错误了, 我认为如此声明只是为数组开辟了空间而已, 在其空间上默认值为NULL。

  7、 关于启动 gc 的方法:

  System.gc() 和 RunTime()类的 gc() 方法, 但是即使调用了前面的方法也不保证一定会进行回收。

  拓展之:

  a. GC并不是定期来回收你的垃圾内存,即是根据需要来回收。

  b. GC的回收是因为:它认为你的系统已经开始内存紧张(这个就是jvm的神奇)

  c. 即使GC开始准备清理你的垃圾内存,但是如果该内存的引用还存在(不等于null), 这个时候GC仍然无能为力!

  d、 RunTime类的 public static Runtime getRuntime() 返回: 与当前 Java 应用程序相关的 Runtime 对象。

  8、 int i=10, double e = 10.0; 判断(i==e)、 (i==10.0)的真假。

  我认为一个是int类型,一个是double类型,它们分属不同的类型, 所以我认为其是错误的, 然而经运行测试发现是正确的。

  9、 public static void main(String[] args){

  StringBuffer str1 = new StringBuffer("a");

  StringBuffer str2 = new StringBuffer("b");

  conver(str1, str2); }

www.qz26.com

  public static void conver(StringBuffer str1, StringBuffer str2){

  str1.append(str2);

  str2 = str1;

  }

  测试结果为: str1 : ab str2 : b

  10、 唯一索引 与 唯一约束

  create unique index index_name on table_name(column)。

  建立唯一索引会自动生成一个唯一索引(唯一性约束是通过唯一性索引来实现的)。

  约束是为了保证数据满足约束条件的数据完整性, 而索引通常是为了提高查询的速度。

  ——————拓展:

  唯一索引, 在物理结构上是完全一样的, 而实际上, 非唯一索引其实也是索引的一种, 只是非唯一索引把rowId也编程了键值的一部分; 在用途上, 唯一索引与非唯一索引的区别在于优化器在优化查询时应用索引时做了取舍。

  如果是唯一索引则采取 index unique scan, 如果是非唯一性索引,则采取 index range scan.

[1] [2]  下一页


Tag:笔试题目银行笔试题目,企业笔试题目求职笔试面试 - 笔试题目
【字号: 】 【打印】 【关闭
《数据库oracle笔试》相关文章
最新更新
推荐热门
联系我们 | 网站地图 | 财务资料 | 范文大全 | 求职简历 | 财会考试 | 成功励志
Copyright 二六求职资料网 All Right Reserved.
1 2 3 4 5 6 7 8 9 10