Drop Table CustOrders;
Drop Table Customers;
Drop Table products;
Drop Table Status;
Drop Sequence seqProduct;
Drop Sequence seqStatus;
Drop Sequence seqCustomer;
Drop Sequence seqCustOrders;


Create Table Customers
(
  Cust_ID integer primary key,
  Cust_Name varchar2(50),
  Cust_Adress varchar2(75),
  Cust_Number integer
)
;

CREATE TABLE products
(
    Prod_ID integer primary key, 
    Prod_Name varchar2(50) Not Null,
    Prod_Price number(7,2) NOT NULL, 
    Prod_URL VARCHAR2(200),
    Prod_Pic VARCHAR2(200)
)
;

CREATE TABLE Status
(
    Stat_ID integer primary key, 
    Stat_Number integer Not NULL, 
    Stat_Desc varchar2(50) NOT NULL
)
;

Create Table CustOrders
(
  Order_ID integer primary key,
  Order_Cust_ID integer CONSTRAINT fk_OrderCust REFERENCES customers(Cust_ID), 
  Order_Prod_ID integer CONSTRAINT fk_OrderProd REFERENCES products(Prod_ID), 
  Order_Number integer,
  Order_Sign varchar2(20),
  Order_Status integer CONSTRAINT fk_OrderStatus REFERENCES Status(Stat_ID)
)
;

Create Sequence seqproduct increment by 1;
Create Sequence seqStatus increment by 1;
Create Sequence seqcustomer increment by 1;
Create Sequence seqCustOrders increment by 1;