RENAME EMP_TEMP TO EMP_TEMP5;
SELECT * FROM EMP_TEMP5;
INSERT INTO EMP_TEMP5 VALUES (1, 'David','AA' )
TRUNCATE TABLE EMP_TEMP5;
DROP TABLE EMP_TEMP5;
SELECT * FROM EMPLOYEES;
SELECT FIRST_NAME, LAST_NAME, SALARY, JOB_ID FROM EMPLOYEES;
SELECT COUNT(*) FROM EMPLOYEES;
SELECT DEPARTMENT_ID FROM EMPLOYEES e ;
SELECT DISTINCT DEPARTMENT_ID FROM EMPLOYEES ;
SELECT DISTINCT JOB_ID FROM EMPLOYEES ;
SELECT DISTINCT DEPARTMENT_ID, JOB_ID FROM EMPLOYEES ;
SELECT EMP.EMPLOYEE_ID AS "사원 아이디" ,
EMP.FIRST_NAME AS 이름
FROM EMPLOYEES EMP;
SELECT EMPLOYEE_ID,
FIRST_NAME || ' ' || LAST_NAME "이름"
FROM EMPLOYEES e ;
SELECT * FROM DUAL;
SELECT 3*4 FROM DUAL;
SELECT SYSDATE FROM DUAL;
SELECT 'TEST' , 3 , 5 FROM DUAL;
INSERT INTO REGIONS_TEMP VALUES (60, 'Utopia');
UPDATE REGIONS_TEMP
SET REGION_NAME = 'Dystopia'
WHERE REGION_ID = 80;
DELETE
FROM REGIONS_TEMP
WHERE REGION_NAME = 'UTOPIA';
SELECT *
FROM EMPLOYEES e
WHERE DEPARTMENT_ID = 100;
SELECT *
FROM EMPLOYEES e
WHERE JOB_ID = 'FI_MGR';
SELECT *
FROM EMPLOYEES e
WHERE SALARY > 12000;
SELECT *
FROM EMPLOYEES e
WHERE DEPARTMENT_ID != 90;
SELECT *
FROM EMPLOYEES e
WHERE NOT DEPARTMENT_ID = 90;
SELECT *
FROM EMPLOYEES e
WHERE DEPARTMENT_ID = 90 AND SALARY >20000;
SELECT *
FROM EMPLOYEES e
WHERE DEPARTMENT_ID = 90 OR DEPARTMENT_ID = 100;
SELECT *
FROM EMPLOYEES e
WHERE DEPARTMENT_ID IN (90,100);
SELECT *
FROM EMPLOYEES e
WHERE NOT DEPARTMENT_ID IN (90,100);
SELECT *
FROM EMPLOYEES e
WHERE SALARY BETWEEN 12000 AND 20000
AND DEPARTMENT_ID != 90;
SELECT EMPLOYEE_ID,
FIRST_NAME,
HIRE_DATE
FROM EMPLOYEES e
WHERE HIRE_DATE BETWEEN TO_DATE('16/01/01','YY/MM/DD') AND TO_DATE('16/12/31', 'YY/MM/DD')
AND DEPARTMENT_ID ^= 90;
SELECT FIRST_NAME,
JOB_ID
FROM EMPLOYEES e
WHERE JOB_ID LIKE '%ST%';
SELECT FIRST_NAME,
JOB_ID
FROM EMPLOYEES e
WHERE JOB_ID LIKE 'S__CLERK';
SELECT * FROM EMPLOYEES e ;
SELECT *
FROM EMPLOYEES e
WHERE MANAGER_ID IS NULL;
SELECT *
FROM EMPLOYEES e
WHERE COMMISSION_PCT IS NOT NULL;
SELECT EMPLOYEE_ID,
FIRST_NAME,
SALARY,
COMMISSION_PCT
FROM EMPLOYEES
WHERE COMMISSION_PCT IS NULL AND SALARY < 10000 ;
SELECT EMPLOYEE_ID,
FIRST_NAME
FROM EMPLOYEES e
WHERE FIRST_NAME LIKE '%A%';
SELECT EMPLOYEE_ID,
FIRST_NAME,
ROWNUM
FROM EMPLOYEES e
WHERE FIRST_NAME LIKE '%A%'
AND ROWNUM = 1;
SELECT ROWNUM, EMPLOYEES.* FROM EMPLOYEES
WHERE ROWNUM < 3;
SELECT LOWER ('SQL Expert') ,
UPPER ('SQL Expert') ,
CONCAT ('SQL', 'Expert') ,
SUBSTR ('SQL Expert', 1, 3 ),
LENGTH ('SQL Expert') ,
LTRIM (' SQL'),
RTRIM (' SQL '),
TRIM(' SQL '),
ASCII('F'),
CHR('70')
FROM DUAL;
SELECT UPPER(FIRST_NAME), LENGTH (FIRST_NAME)
FROM EMPLOYEES e ;
SELECT DISTINCT SUBSTR(JOB_ID, 1,2) FROM EMPLOYEES e ;
SELECT JOB_ID FROM EMPLOYEES e ;
SELECT SUBSTR(JOB_ID, 4) FROM EMPLOYEES e ;
SELECT SUBSTR(JOB_ID, LENGTH(JOB_ID) - 1) FROM EMPLOYEES;
SELECT DISTINCT SUBSTR (JOB_ID,LENGTH (JOB_ID)-1,LENGTH (JOB_ID))
FROM EMPLOYEES e;
SELECT EMPLOYEE_ID , FIRST_NAME , LAST_NAME
FROM EMPLOYEES e
WHERE UPPER(LAST_NAME) LIKE '%SMITH%';