day 34 作业
2024-08-29 00:31:05
作业
mysql> create table tea(
-> id int unsigned auto_increment primary key,
-> name varchar(50),
-> age int,
-> salary int,
-> desclib varchar(50) default null
-> )charset=utf8;
insert into tea(name,age,salary) values ('Jackie','19','9000');
insert into tea(name,age,salary) values ('Coach','32','30000');
insert into tea(name,age,salary) values ('Andy','26','15000');
insert into tea(name,age,salary) values ('jinx','16','3500');
# 1. 查看岗位是teacher的员工姓名、年龄
select name,age from tea;
# 2. 查看岗位是teacher且年龄大于30岁的员工姓名、年龄
select name,age from tea where age>30;
# 3. 查看岗位是teacher且薪资在9000-1000范围内的员工姓名、年龄、薪资
select name,age,salary from tea where salary between 1000 and 9000;
# 4. 查看岗位描述不为NULL的员工信息
select * from tea where desclib is not null;
# 5. 查看岗位是teacher且薪资是10000或9000或30000的员工姓名、年龄、薪资
select name,age,salary from tea where salary in (10000,9000,30000)
# 6. 查看岗位是teacher且薪资不是10000或9000或30000的员工姓名、年龄、薪资
select name,age,salary from tea where salary not in (10000,9000,30000);
# 7. 查看岗位是teacher且名字是jin开头的员工姓名、年薪
select name,salary*12 from tea where name like 'jin%';
最新文章
- BZOJ3110: [Zjoi2013]K大数查询
- HDU 5980 Find Small A(寻找小A)
- Web前端面试题集锦
- 求两个数的最大公约数(Java)
- 将Excel生成实体类
- UISegmentedControl 分段器加载不同的viewcontroller
- ubuntu 12.04版本出现界面终端打开broken pipe,但是tty1这些可以。
- Convert.ToInt32()与int.Parse()的区别 (转载)
- JAVA环境变量正确设置,却无法在cmd中javac
- [转]C++宏定义详解
- Python库:序列化和反序列化模块pickle介绍
- 阿里巴巴Java开发手册评
- Linux在shell中进入python敲方向键出现「^[[C^[[D」的解决办法
- [转载]lib和dll文件的区别和联系
- 绑定属性 - v-bind
- 【转】完整精确导入Kernel与Uboot参与编译了的代码到Source Insight,Understand, SlickEdit
- 关于UIPageViewController那些事
- unittest框架断言方法
- Spark-1.2.2部署
- [BZOJ4567][SCOI2016]背单词(Trie+贪心)