Home >> FAQs/Tutorials >> Oracle Tutorials

Oracle Tutorials - Create a New View

By: FYIcenter.com

(Continued from previous topic...)

How To Create a New View?

You can create a new view based on one or more existing tables by using the CREATE VIEW statement as shown in the following script:

CREATE VIEW employee_department AS 
  SELECT e.employee_id, e.first_name, e.last_name, 
    e.email, e.manager_id, d.department_name 
  FROM employees e, departments d
  WHERE e.department_id = d.department_id;
View created.

SELECT first_name, last_name, department_name 
  FROM employee_department WHERE manager_id = 101;
FIRST_NAME           LAST_NAME           DEPARTMENT_NAME
-------------------- ------------------- ----------------
Nancy                Greenberg           Finance
Jennifer             Whalen              Administration
Susan                Mavris              Human Resources 
Hermann              Baer                Public Relations
Shelley              Higgins             Accounting

(Continued on next topic...)

  1. What Are DDL Statements?
  2. How To Create a New Table?
  3. How To Create a New Table by Selecting Rows from Another Table?
  4. How To Add a New Column to an Existing Table?
  5. How To Delete a Column in an Existing Table?
  6. How To Drop an Existing Table?
  7. How To Create a Table Index?
  8. How To Rename an Index?
  9. How To Drop an Existing Index?
  10. How To Create a New View?
  11. How To Drop an Existing View?

Oracle Tutorials:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...