반응형

 

Oracle Database 10g SQL Fundamentals I - Practice 10

1.
CREATE OR REPLACE VIEW EMPLOYEES_VU
AS SELECT EMPLOYEE_ID, LAST_NAME AS EMPLOYEE, DEPARTMENT_ID
FROM EMPLOYEES;


2.
SELECT * FROM EMPLOYEES_VU;


3.
SELECT EMPLOYEE, DEPARTMENT_ID FROM EMPLOYEES_VU;


4.
CREATE OR REPLACE VIEW DEPT50
AS
SELECT EMPLOYEE_ID AS EMPNO, LAST_NAME AS EMPLOYEE, DEPARTMENT_ID AS DEPTNO
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 50;
-- WITH CHECK OPTION CONSTRAINT EMP_DEPT_50;


5.
SELECT * FROM DEPT50;


6.
UPDATE DEPT50
SET DEPTNO = 80
WHERE EMPNO = 143
;


7.
CREATE SEQUENCE DEPT_ID_SEQ
START WITH 200
INCREMENT BY 10
MAXVALUE 1000
;


8. ???


9.
CREATE INDEX DEPT_DNAME_IDX ON DEPT(DNAME);


10.
CREATE SYNONYM EMP01 FOR EMPLOYEES;

반응형