Mysql 题:
1.
创建员工表(emp),
员工编号eid 整型 主键 自增
员工姓名ename 字符型 不为空 且唯一
员工年龄eage 整型 默认值0
员工所属车间编号 cid 整型
员工工资esalary 浮点型 总长度10,其中3位小数
员工生日ebirthday 日期型
create table emp(
eid int primary key auto_increment,
ename varchar not null unique,
eage int default 0,
cid int,
esalary double(10,3),
ebirthday date
);
2. 向emp表的所有字段插入数据
insert into emp(ename,eage,cid,esalary,ebirthday) values('张三',20,100,10000,'2000-01-01');
3. 更改工号为1001的年龄,让其加2岁
update emp set eage=eage+2 where eid=1001;
4. 删除工号为1001的员工信息
delete from emp where eid=1001;
5. 查询员工性别为女,并且年龄小于50的记录
select * from emp where esex='女' and eage<50;
6. 查询工号为1001,1002,1003的记录
select * from emp where eid in(1001,1002,1003);
7. 查询姓名中包含“三”的员工记录
select * from emp where ename like '%三%';
8. 查询所有员工记录,按年龄升序排序,如果年龄相同时,按编号降序排序
select * from emp order by eage asc,eid desc;
9. 查询emp表中工资大于600.1的人数:
select count(eid) from emp where esalary>600.1;
10. 查询年龄不重复的员工共有多少人
select coun(distinct(eage)) from emp;
11. 查询每个车间的车间编号以及每个车间工资大于600.1的人数:
select cid,count(esalary>600.1 or null) from emp group by cid;
12.查询工资总和大于10000的车间编号以及工资和
select cid,sum(esalary) from emp group by cid having sum(esalary)>10000;
java 题:
1. 利用HashMap的entrySet()方法遍历HashMap集合
public void test(HashMap<String,String> hm){
for(Entry<String,String> e : hm.entrySet()){
System.out.println(e.getKey());
System.out.println(e.getValue());
}
}
js 题:
1. 现有<input type="button" value="按钮">一个按钮:
[写出JavaScript代码]为该按钮绑定一个点击事件,触发事件,弹出警告框
<script type="text/JavaScript">
var i = document.getElementsByTagName("input");
i[0].onclick = function(){
alert("方式1");
}
i[0].onclick = "alert('方式2')";
</script>
2. 根据要求写出完成js代码
<input id="i1" type="text" name="username" value="admin">
1) 设置元素对象的字体变红
2) 控制台输出元素的内容
3) 设置元素的值为'123456'
4) 设置元素由文本框变为密码框
<script type="text/JavaScript">
var i1=document.getElementById("i1");
i1.style.color="red";
console.log(i1.value);
i1.value="123456";
i1.type="password";
</script>
3. 写出正则表达式,校验邮箱
1233abc@qq.com
def23@163.cn
要求:
1. 必须出现@符号
2. @符号前字符至少1个,数字和字母均可
3. @符号后字符至少1个,数字和字母均可
4. 必须有.
5. .号后字符至少2个,只能字母
var reg = /^[A-Za-z\d]+@[A-Za-z\d]+\.[A-Za-z]{2,}$/;