Oracle View - Javatpoint
Oracle View - Javatpoint
In Oracle, view is a virtual table that does not physically exist. It is stored in Oracle
data dictionary and do not store any data. It can be executed when called.
CREATE VIEW view_name AS
SELECT columns
FROM tables
WHERE conditions;
Dataddo
Data Management Tool
OPEN
All your analytics, social, business and ⇧
OPEN
customer data in your BI or Dashboard.
Parameters:
view_name: It specifies the name of the Oracle VIEW that you want to
create.
Example:
Let's take an example to create view. In this example, we are creating two tables
suppliers and orders first.
Cross boundaries
with Python
Edureka
OPEN
Suppliers table:
CREATE TABLE "SUPPLIERS"
( "SUPPLIER_ID" NUMBER,
"SUPPLIER_NAME" VARCHAR2(4000),
"SUPPLIER_ADDRESS" VARCHAR2(4000)
)
/
Orders table:
⇧
CREATE TABLE "ORDERS"
( "ORDER_NO." NUMBER,
"QUANTITY" NUMBER,
"PRICE" NUMBER
)
/
Ad
CREATE VIEW sup_orders AS
SELECT suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers
INNER JOIN orders
ON suppliers.supplier_id = supplier_id
⇧
WHERE suppliers.supplier_name = 'VOJO';
Output:
View created.
0.21 seconds
SELECT * FROM sup_orders;
Output:
Syntax:
CREATE OR REPLACE VIEW view_name AS
SELECT columns
FROM table
WHERE conditions;
⇧
Example:
Execute the following query to update the definition of Oracle VIEW called
sup_orders without dropping it.
CREATE or REPLACE VIEW sup_orders AS
SELECT suppliers.supplier_id, orders.quantity, orders.price
FROM suppliers
INNER JOIN orders
ON suppliers.supplier_id = supplier_id
WHERE suppliers.supplier_name = 'HCL';
SELECT * FROM sup_orders;
Output:
Syntax:
⇧
DROP VIEW view_name;
Example:
DROP VIEW sup_orders;
← prev next →
Sponsored by
Open
trailhead.salesforce.com
Preparation
⇧
Interview Company
Trending Technologies
Selenium
tutorial
Selenium
AI AWS
B.Tech / MCA
.Net
Data Mining
Tutorial
Data Mining