DROP TABLE ejbAccounts;
CREATE TABLE ejbAccounts (id varchar(15), bal float, type varchar(15));

DROP TABLE idGenerator;
CREATE TABLE idGenerator (tablename varchar(32), maxkey int);

DROP TABLE CUSTOMER;
CREATE TABLE customer(
   custid     int not null,
   name       varchar(30),
   address    varchar(30),
   city       varchar(30),
   state      varchar(2),
   zip        varchar(5),
   area       varchar(3),
   phone      varchar(8));

insert into customer values
   (100,'Jackson','100 First St.','Pleasantville','CA','95404','707','555-1234');
insert into customer values
   (101,'Elliott','Arbor Lane, #3','Centre Town','CA','96539','415','787-5467');
insert into customer values
   (102,'Avery','14 Main','Arthur','CA','97675','510','834-7476');

DROP TABLE emp;
CREATE TABLE emp (
   empno      int not null,
   ename      varchar(10),
   job        varchar(9),
   mgr        int,
   hiredate   date,
   sal        float,
   comm       float,
   deptno     int);

create unique index empno on emp(empno);

insert into emp values
   (7369,'SMITH','CLERK',7902,DATE'1980-12-17',800,NULL,20);
insert into emp values
   (7499,'ALLEN','SALESMAN',7698,DATE'1981-02-20',1600,300,30);
insert into emp values
   (7521,'WARD','SALESMAN',7698,DATE'1981-02-22',1250,500,30);
insert into emp values
   (7566,'JONES','MANAGER',7839,DATE'1981-04-02',2975,NULL,20);
insert into emp values
   (7654,'MARTIN','SALESMAN',7698,DATE'1981-09-28',1250,1400,30);
insert into emp values
   (7698,'BLAKE','MANAGER',7839,DATE'1981-05-1',2850,NULL,30);
insert into emp values
   (7782,'CLARK','MANAGER',7839,DATE'1981-06-9',2450,NULL,10);
insert into emp values
   (7788,'SCOTT','ANALYST',7566,DATE'1981-06-9',3000,NULL,20);
insert into emp values
   (7839,'KING','PRESIDENT',NULL,DATE'1981-11-17',5000,NULL,10);
insert into emp values
   (7844,'TURNER','SALESMAN',7698,DATE'1981-09-8',1500,0,30);
insert into emp values
   (7876,'ADAMS','CLERK',7788,DATE'1981-06-9',1100,NULL,20);
insert into emp values
   (7900,'JAMES','CLERK',7698,DATE'1981-12-3',950,NULL,30);
insert into emp values
   (7902,'FORD','ANALYST',7566,DATE'1981-12-3',3000,NULL,20);
insert into emp values
   (7934,'MILLER','CLERK',7782,DATE'1982-01-23',1300,NULL,10);

DROP TABLE dept;
create table dept(
   deptno     int not null,
   dname      varchar(10),
   loc        varchar(9));

insert into dept values
   (10,'ACCOUNTING','NEW YORK');
insert into dept values
   (20,'RESEARCH','DALLAS');
insert into dept values
   (30,'SALES','CHICAGO');
insert into dept values
   (40,'OPERATIONS','BOSTON');

DROP TABLE finderEnum;
create table finderEnum(
   id          varchar(10),
   bal         float not null);

insert into finderEnum values
   ('PK1',  0);
insert into finderEnum values
   ('PK2',  0);
insert into finderEnum values
   ('PK3',  0);
insert into finderEnum values
   ('PK4',  0);
insert into finderEnum values
   ('PK5',  0);
insert into finderEnum values
   ('PK6',  1);
insert into finderEnum values
   ('PK7',  1);
insert into finderEnum values
   ('PK8',  1);
insert into finderEnum values
   ('PK9',  1);
insert into finderEnum values
   ('PK10', 1);

DROP TABLE StockTable;
create table StockTable(
   symbol      varchar(10),
   price       float,
   yearHigh    float,
   yearLow     float,
   volume      int);