myemployeesを使用します.sqlはsql言語の条件クエリーを行う
条件クエリー
# 2:
/*
:
select
from
where
;
:
、
:> < = != <> <= >=
、
:&& || !
and or not
、
like
between and
in
is null
*/
# 、
# 1: >12000
SELECT
*
FROM
employees
WHERE
salary>12000;
# 2: 90
SELECT last_name, department_id
FROM employees
WHERE department_id <>90;
# 、
# 1: 10000 20000 、
SELECT last_name,salary,commission_pct
FROM employees;
WHERE salary>=10000 AND salary<=20000;
# 、
#1.like % , 0 _
# 1: a
SELECT *
FROM employees
WHERE last_name LIKE '%a%';
# 2: e, a
SELECT last_name,salary
FROM employees
WHERE last_name LIKE '__e_a%';
# 3: _
SELECT last_name
FROM employees
WHERE last_name LIKE '_\_%';
#2.between and ,
# 1: 100 120
SELECT *
FROM employees
WHERE employee_id BETWEEN 100 AND 120;
#3. in
# : IT_PROG、AD_VP、AD_PRES
SELECT last_name, job_id
FROM employees
WHERE job_id IN ('IT_PROG','AD_VP','AD_PRES');
#4. is null = <> null
# 1:
SELECT last_name,commission_pct
FROM employees
WHERE commission_pct IS NULL;
# <=>
# 1:
SELECT last_name,commission_pct
FROM employees
WHERE commission_pct <=> NULL;
# 12: 12000
SELECT
*
FROM
employees
WHERE
salary <=> 12000;