background image
<< Dropping Tables | Creating a View in SQL Script >>
<< Dropping Tables | Creating a View in SQL Script >>

Creating Views

Using Views
Creating and Using Database Objects 3-21
3.
In the Drop window, click Apply.
4.
In the Confirmation window, click OK.
You deleted the table
TEMP_TABLE
. The following script is the equivalent SQL
statement for dropping this table.
DROP TABLE "HR"."TEMP_TABLE";
Using Views
Views are logical tables based on one or more tables or views. Views are particularly
useful if your business needs include frequent access to information that is stored in
several different tables.
Creating a View
The standard syntax for creating a view follows:
CREATE VIEW
view_name
AS
query
;
To create a view using the SQL Developer interface:
Follow these steps to delete create a new view from the
hr
schema.
1.
In the Connections navigation hierarchy, right-click Views.
2.
Select New View.
3.
In the Create View window, enter the following parameters:
Ensure that Schema is set to
HR
.
Set Name to
SALESFORCE
.
Set the SQL Query to the following:
SELECT first_name || ' ' || last_name "Name", salary*12 "Annual Salary"
FROM employees
WHERE department_id = 80
4.
In SQL Parse Results, click Test Syntax.
See Also:
Oracle Database SQL Language Reference for information on the
DROP TABLE
statement