CREATE SCHEMA Example The following statement creates a schema named oe for the sample order-entry user oe, creates the table new_product, creates the view new_product_view, and grants SELECT privilege on new_product_view to the sample human resources user hr. CREATE SCHEMA AUTHORIZATION oe CREATE TABLE new_product (color VARCHAR2(10) PRIMARY KEY, quantity NUMBER) CREATE VIEW new_product_view AS SELECT color, quantity FROM new_product WHERE color = 'RED' GRANT select ON new_product_view TO hr;
The following statement creates a schema named oe for the sample order-entry user oe, creates the table new_product, creates the view new_product_view, and grants SELECT privilege on new_product_view to the sample human resources user hr. CREATE SCHEMA AUTHORIZATION oe
CREATE TABLE new_product
(color VARCHAR2(10) PRIMARY KEY, quantity NUMBER)
CREATE VIEW new_product_view
AS SELECT color, quantity FROM new_product WHERE color = 'RED'
GRANT select ON new_product_view TO hr;