background image

软件开发工程师试题

1、试分析下面的 SQL 语句的优劣,并用另外的方法实现。

(1) Select * from empe where e.No in (select a. No from amp a )

Select * from empe e where NOT EXISTS (Select a.No from amp a where e.NO=a.No)

(2) select * from emp e, anp a where e. No=a. No

2、用 Decoole 重写下面的 socl 语句
     

SELECT

 

COUNT

(*),

SUM

(

SAL

FROM

 

EMP

 

WHERE

 

DEPT

_

NO

 = 0020 

AND

 

ENAME

 

LIKE

 

SMITH

%';

     select count(*),sum(sal) from emp where dept_no = 0030 and ename like ‘

  smith%';

                  
         select count(decode(dept_no,0020,'x',null)) d0020_count,
               count(decode(dept_no,0030,'x',null)) d0030_count,  
               sum(decode(dept_no,0020,sal,0)) d0020_sal,
               sum(decode(dept_no,0030,sal,0)) d0030_sal
         from emp where ename like ‘smith%';                 
3、下面哪几种 SQL 不好。2,4,5

(1) update 

  

语句 (2)in

  

语句 (3)

  

子查询 (4)

  

多查等值查询 (5)笛卡尔乘积

4、请造出下列哪 3

 

种命名正确 A,B,D

   A、ASD

B、$abc

C、const

D、_asd

E、3_asd

5、texarea  java  (1)写出文件名

(2)补充代码

6、型转换
  example:
   public String getValue(Object a,Object b){}
  当下列方法调用时将出现何种异常,如何修正
  String c=new String(“aaa”);

int d =123;

  my.getValue(c,d);

(1) Integer d=new Integer(123);
(2) My.getValue(c,(String)d);

7、在 JSP 上显示 Araylist 中的元素
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "java.util.ArrayList"%>
<html>
<head>
<title>
jsp1
</title>
</head>
<body bgcolor="#ffffff">
<%
   ArrayList al = request.getAttribute("arraylist");
%>
<!--在 al 中存储的是学生的姓名;请在下面的 Table 中把所有的学生姓名显示出来-->
<table>
<tr>