Taller 4-KATHERN ROJAS PDF
Taller 4-KATHERN ROJAS PDF
1. Create a view called EMP_VU based on the employee number, employee name, and
department number from the EMP table. Change the heading for the employee name to
EMPLOYEE.
1. CREATE VIEW emp_vu AS
SELECT empno, ename EMPLOYEE, deptno from emp;
4. Using your view EMP_VU, enter a query to display all employee names and department
numbers.
RTA: create or replace view emp_vu
as select ename EMPLOYEE, deptno DEPTNO
from emp;
5. Create a view named DEPT20 that contains the employee number, employee name, and
department number for all employees in department 20. Label the view column
EMPLOYEE_ID, EMPLOYEE, and DEPARTMENT_ID. Do not allow an employee to be
reassigned to another department through the view.
RTA create or replace view dept20
as select empno EMPLOYEE_ID, ename EMPLOYEE, deptno
DEPARTMENT_ID
from emp
where deptno=20
with check option;
8. Create a view called SALARY_VU based on the employee name, department name, salary,
and salary grade for all employees. Label the columns Employee, Department, Salary, and
Grade, respectively.
CREATE VIEW salary_vu AS
SELECT ename employee, dname department,
sal salary, grade
FROM emp e, dept d, salgrade s
WHERE e.deptno = d.deptno
AND e.sal between s.losal and s.hisal;