恒生电子2012实习笔试题
2015-08-26 17:21
197 查看
![](http://images0.cnblogs.com/blog2015/732320/201508/261701261722686.png)
![](http://images0.cnblogs.com/blog2015/732320/201508/261701582811995.png)
![](http://images0.cnblogs.com/blog2015/732320/201508/261703000949612.png)
![](http://images0.cnblogs.com/blog2015/732320/201508/261703121721937.png)
![](http://images0.cnblogs.com/blog2015/732320/201508/261703291875634.png)
![](http://images0.cnblogs.com/blog2015/732320/201508/261702354535650.png)
一、不定项选择题
1、B
2、AD
3、CD
4、A
5、ACD
6、BD
7、C
8、BCD
9、C
10、AB 主键不一定能提高查找的速度
二、填空题
1、奇,偶
2、ls -l,ps -aux
3、
4、BABBAB
5、数据定义,数据操作,数据控制
三、数据库
1、
create table S(
Sno int primary key auto_increment,
Sname varchar(20)
);
insert into S(sname) values('he');
insert into S(sname) values('wang');
create table C(
Cno int primary key auto_increment,
Cname varchar(20),
Ccredit int
);
insert into C(cname,Ccredit) values('JAVA',3);
insert into C(cname,Ccredit) values('C',2);
Drop table if exists SC;
create table SC(
id int primary key auto_increment,
Sno int,
Cno int,
Grade int
);
insert into SC(Sno,cno,Grade) values(1,1,100);
insert into SC(Sno,cno,Grade) values(1,2,90);
insert into SC(Sno,cno,Grade) values(2,1,80);
insert into SC(Sno,cno,Grade) values(2,2,70);
insert into SC(Sno,cno,Grade,Teacher) values(3,1,80,'zhang');
insert into SC(Sno,cno,Grade,Teacher) values(3,2,70,'zhang');
1)select distinct Sname From S,SC,C where S.sno = SC.sno and c.Cno = SC.cno and
Cname='JAVA' order by Sname desc;
2)select S.Sno,Sum(Ccredit) From S,SC,C where S.sno = SC.sno and c.Cno = SC.cno
and Grade>60 group by Sno having sum(Ccredit)>80;
3)ALTER table SC ADD Teacher varchar(20) not null;
4)CREATE VIEW SCSum(sno,Ccredit) as Select S.Sno,Sum(Ccredit) From S,SC,C
where S.sno = SC.sno and c.Cno = SC.cno group by Sno;
5)delete from SC where sno not in(select distinct S.Sno from S);
四、程序设计题
package hengsheng; public class Exe1 { public static void main(String[] args) { for(int i=123;i<330;i++){ int a = i*2; int b = i*3; if(isok(i,a,b)){ System.out.println(i+","+a+","+b); } } } /** * 判断三个整数中是否有重复的字符 * @return false:有;true:否 */ private static boolean isok(int i,int a,int b) { int[] s = new int[9]; s[0] = i%10; s[1] = i%100/10; s[2] = i/100; s[3] = a%10; s[4] = a%100/10; s[5] = a/100; s[6] = b%10; s[7] = b%100/10; s[8] = b/100; //判断s中是否有相同的数字 for(int j=0;j<s.length;j++){ for(int k=j;k<s.length;k++){ if(j != k && s[j] == s[k]) return false; } } return true; } }
相关文章推荐
- 转载分享:Android APP二次打包操作步骤介绍
- test 2.1-4
- Block
- 数组去重
- POJ3070 - Fibonacci (矩阵快速幂)
- 11111
- HoughLinesP函数(概率检测直线)
- 监督算法大比拼之BP、SVM、adaboost非线性多分类实验
- android执行移动动画后按钮点击错位问题解决
- 数据结构:胜者树与败者树
- Python sys.path.append
- 【使用JSOUP实现网络爬虫】使用DOM方法来遍历一个文档
- I NEED A OFFER! 1203 (01背包变形+数学)
- leetcode 153 : Find Minimum in Rotated Sorted Array
- 返回一张可以随意拉伸不变形的图片
- MongoDB基本使用
- ThreadLocalTest
- python generator 的惰性计算
- Android资源访问机制—获取Resources对象
- 同步方法