作业

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%';

最新文章

  1. BZOJ3110: [Zjoi2013]K大数查询
  2. HDU 5980 Find Small A(寻找小A)
  3. Web前端面试题集锦
  4. 求两个数的最大公约数(Java)
  5. 将Excel生成实体类
  6. UISegmentedControl 分段器加载不同的viewcontroller
  7. ubuntu 12.04版本出现界面终端打开broken pipe,但是tty1这些可以。
  8. Convert.ToInt32()与int.Parse()的区别 (转载)
  9. JAVA环境变量正确设置,却无法在cmd中javac
  10. [转]C++宏定义详解
  11. Python库:序列化和反序列化模块pickle介绍
  12. 阿里巴巴Java开发手册评
  13. Linux在shell中进入python敲方向键出现「^[[C^[[D」的解决办法
  14. [转载]lib和dll文件的区别和联系
  15. 绑定属性 - v-bind
  16. 【转】完整精确导入Kernel与Uboot参与编译了的代码到Source Insight,Understand, SlickEdit
  17. 关于UIPageViewController那些事
  18. unittest框架断言方法
  19. Spark-1.2.2部署
  20. [BZOJ4567][SCOI2016]背单词(Trie+贪心)

热门文章

  1. Web服务器—IIS
  2. 监控类shell脚本
  3. kafka相关操作
  4. Java面试之synchronized 和 static synchronized
  5. CAS你知道吗?原子类AtomicInteger的ABA问题谈谈?
  6. Pwn-TestYourMemory
  7. [随笔]ICPC2.0
  8. 【2019.8.6 慈溪模拟赛 T2】树上路径(tree)(Trie)
  9. csps2019记
  10. Windows Terminal (Preview)治好了cmd,powershell的癌症