Create Table Examples

Example 1

create table PRODUCTS
 (

PRODUCT_IDNUMBER(4))not null,
DESCRIPTIONVARCHAR2(1000),
PRICENUMBER(12,2),
CURRENCYVARCHAR2(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;