create table customer(
    store_num integer not null,
    store_name char(20),
    addr char(20),
    addr2 char(20),
    city char(15),
    state char(2),
    zipcode char(5),
    contact_name char(30),
    phone char(18), 
    PRIMARY KEY (store_num));

 create table orders(
    order_num integer not null,
    order_date date,
    store_num integer not null,
    fac_code char(3),
    ship_instr char(10),
    promo char(1),    
    PRIMARY KEY (order_num));

create table factory(
    fac_code char(3) NOT NULL,
    fac_name char(15),
 PRIMARY KEY (fac_code));

create table stock(
    stock_num integer NOT NULL,
    fac_code char(3) NOT NULL,
    description char(15),
    reg_price decimal(8,2),
    promo_price decimal(8,2),
    price_updated date,
    unit char(4),
  PRIMARY KEY (stock_num, fac_code));

 create table items(
    order_num integer,
    stock_num integer not null,
    quantity smallint,
    price decimal(8,2),
    PRIMARY KEY (order_num, stock_num));

create table state(
    state_code char(2) NOT NULL,
    state_name char(15),
    PRIMARY KEY (state_code));






