zoukankan      html  css  js  c++  java
  • 数据库select作业

    作业:

    1. 查看岗位是teacher员工姓名、年龄

      SELECT emp_name,age FROM youku.employee where post = 'teacher';

    2. 查看岗位是teacher且年龄大于30岁的员工姓名、年龄

    SELECT emp_name,age FROM youku.employee where post = 'teacher' and age >30;


    3. 查看岗位是teacher且薪资在9000-1000范围内的员工姓名、年龄、薪资

    SELECT emp_name,age,salary FROM youku.employee where salary>=1000 and salary <=9000;


    4. 查看岗位描述不为NULL的员工信息

    SELECT * FROM youku.employee where post_comment is not null;


    5. 查看岗位是teacher且薪资是10000或9000或30000的员工姓名、年龄、薪资

    SELECT emp_name,age,salary FROM youku.employee where post='teacher' and salary in (1000,9000,30000);


    6. 查看岗位是teacher且薪资不是10000或9000或30000的员工姓名、年龄、薪资

    SELECT emp_name,age,salary FROM youku.employee where post='teacher' and salary <>1000 and salary <>9000 and salary <> 30000  ;

    7. 查看岗位是teacher且名字是jin开头的员工姓名、年薪

    SELECT emp_name,age,salary FROM youku.employee where post='teacher' and emp_name like 'ja%'

    创建的表:

    create table employee(
    id int not null unique auto_increment,
    emp_name varchar(20) not null,
    sex enum('male','female') not null default 'male', # 大部分是男的
    age int(3) unsigned not null default 28,
    hire_date date not null,
    post varchar(50),
    post_comment varchar(100),
    salary double(15,2),
    office int, 
    depart_id int
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8

  • 相关阅读:
    jQuery使用手册之Ajax支持(8)
    jQuery使用手册之动态效果(6)
    jquery插件 操作select
    提高jQuery的性能
    jQuery起点教程之使用AJAX(4)
    jQuery起点教程之插件制作(7)
    IE开发工具栏
    信息安全之DNS欺骗详解
    颜色取色器
    使DIV不被select等控件遮挡的解决办法
  • 原文地址:https://www.cnblogs.com/ygy1997/p/11761214.html
Copyright © 2011-2022 走看看