Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Oracle SQL creating a view. Create a view emp_dept_view containing the employee

ID: 3891494 • Letter: O

Question

Oracle SQL creating a view.

Create a view emp_dept_view containing the employee name, job description, hiredate, and department name columns from the employee and department tables. Use the view in a select command to list the name, job, and hiredate for all employees in the ACCOUNTING department.

CREATE TABLE EMPLOYEES (EMPLOYEE_ID NUMBER(2) NOT NULL, EMPLOYEE_NAME VARCHAR2(20), JOB_ID VARCHAR2 (2), JOB_DESCRIPTION VARCHAR2 (20), HOD NUMBER (2), HIREDATE DATE SALARY NUMBER (10, 2), DEPARTMENT_ID NUMBER (2)); CREATE TABLE DEPARTMENTS (DEPARTMENT_ID NUMBER (2), DEPARTMENT_NAME VARCHAR2 (20), LOCATION VARCHAR2 (20) );

Explanation / Answer

CREATE VIEW emp_dept_view AS
SELECT e.EMPLOYEE_NAME,e.JOB_DESCRIPTION,e.HIREDATE
FROM EMPLOYEE e,DEPARTMENTS d
WHERE d.DEPARTMENT_NAME="ACCOUNTING" and e.DEPARTMENT_ID=d.DEPARTMENT_ID;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote