SELECT ename, job, dno, salary, nvl(commission,0), salary*12, (salary*12)+nvl(commission,0) AS 연봉 //커미션의 널값을 0으로 변환
from employee;
// 중복되는 값을 한개씩만 출력
SELECT DISTINCT dno
from employee;
SELECT sysdate AS "오늘날짜"
from dual;
SELECT *
FROM employee
WHERE ename LIKE 'F%'; //F로 시작하는 사원출력
WHERE ename LIKE '%SC%'; //SC포함하는 사원출력
WHERE ename LIKE '%N'; //N으로 끝나는 사원출력
SELECT *
FROM employee
WHERE salary IN(800,1600,3000) //800or1600or3000 포함하는 연봉출력
SELECT *
FROM employee
WHERE ename = 'SCOTT'; //대문자소문자 구분정확히!
SELECT *
FROM employee
WHERE salary >= 1500; // 1500이상
WHERE salary <> 1500; // 1500아닌거
SELECT *
FROM employee
WHERE commission IS NULL; //커미션이 널값인거 다출력
WHERE commission IS NOT NULL;
SELECT *
FROM employee
ORDER BY salary DESC //정렬순서(내림차순)
ORDER BY salary ASC //정렬순서(오름차순)