zoukankan      html  css  js  c++  java
  • day 34 作业

       # 创建表
       create table oldboy(
       id int unsigned auto_increment primary key,
       name char(10) not null default 'sb',
       age int not null default 0,
       status enum('teacher','student'),
       wage int not null default 0
       )charset=utf8;
       
       # 插入值
       insert into oldboy (name,age,status,wage) values
       ('nick',25,'teacher',10000),
       ('tank',27,'teacher',5000),
       ('jin_sb',33,'teacher',250),
       ('zekai',31,'teacher',20000),
       ('logan',23,'student',0),
       ('dsb',35,'student',0);
       
       # 查看岗位是teacher的员工姓名、年龄
       select name,age from oldboy where status = 'teacher';
       # 查看岗位是teacher且年龄大于30岁的员工姓名、年龄
       select name,age from oldboy where status = 'teacher' and age>30;
       # 查看岗位是teacher且薪资在9000-1000范围内的员工姓名、年龄、薪资
       select name,age,wage from oldboy where status = 'teacher' and wage between 1000 and 9000;
       # 查看岗位描述不为NULL的员工信息
       select * from oldboy where status not is 'null';
       # 查看岗位是teacher且薪资是10000或9000或30000的员工姓名、年龄、薪资
       select name,age,wage from oldboy where status = 'teacher' and (wage between 1000 and 9000 or wage = 3000);
       # 查看岗位是teacher且薪资不是10000或9000或30000的员工姓名、年龄、薪资
       select name,age,wage from oldboy where status = 'teacher' and wage not in (9000,10000,30000);
       # 查看岗位是teacher且名字是jin开头的员工姓名、年薪
       select name,wage*12 as y_wage from oldboy where status = 'teacher' and name like 'jin%';
    
  • 相关阅读:
    阻止事件的默认行为,例如click <a>后的跳转~
    阻止事件冒泡
    IE67不兼容display:inline-block,CSS hack解决
    IE678不兼容CSS3 user-select:none(不可复制功能),需要JS解决
    JS数组常用方法总结
    json 只能用 for-in 遍历
    用实例的方式去理解storm的并发度
    OpenLDAP 搭建入门
    kafka api的基本使用
    kafka基本介绍
  • 原文地址:https://www.cnblogs.com/luocongyu/p/11761215.html
Copyright © 2011-2022 走看看