Oracle Tutorial

Create Table Examples

Example 1

create table PRODUCTS
(
PRODUCT_ID number(4)) not null,
DESCRIPTION varchar2(1000)
PRICE number(12,2)
CURRENCY varchar2(3)
constraint pk_product_id primary key (product_id)
) ;

Example 2

Create table customers_copy As
Select *
From customers
Where type='COMPANY';



Example 3

Create table sales_rep
As ( Select ctr.contract_no, ctr.approve_date,
ctr.amount, c.customer_id, c.name
From contracts ctr, customers c
Where ctr.customer_id = c.customer_id
And ctr.amount > 15000 );

Example 4

Create table new_products
As
Select * From products Where 1=0;