-- Autogenerated: do not edit this file
DROP SEQUENCE  BATCH_STAGING_SEQ ;
DROP SEQUENCE  TRADE_SEQ ;
DROP SEQUENCE  CUSTOMER_SEQ ;
DROP TABLE  BATCH_STAGING ;
DROP TABLE  TRADE ;
DROP TABLE  CUSTOMER ;
DROP TABLE  PLAYERS ;
DROP TABLE  GAMES ;
DROP TABLE  PLAYER_SUMMARY ;
DROP TABLE  ERROR_LOG ;

-- Autogenerated: do not edit this file

CREATE SEQUENCE CUSTOMER_SEQ;
CREATE SEQUENCE BATCH_STAGING_SEQ;
CREATE SEQUENCE TRADE_SEQ;

CREATE TABLE BATCH_STAGING  (
	ID NUMBER(38)  NOT NULL PRIMARY KEY ,  
	JOB_ID NUMBER(38) NOT NULL,
	VALUE BLOB NOT NULL,
	PROCESSED CHAR(1) NOT NULL
) ;

CREATE TABLE TRADE  (
	ID NUMBER(38)  NOT NULL PRIMARY KEY ,  
	VERSION NUMBER(38) ,
	ISIN VARCHAR(45) NOT NULL, 
	QUANTITY NUMBER(38) ,
	PRICE DECIMAL(8,2) , 
	CUSTOMER VARCHAR2(45) 
) ;
 
CREATE TABLE CUSTOMER (
	ID NUMBER(38)  NOT NULL PRIMARY KEY ,  
	VERSION NUMBER(38) ,
	NAME VARCHAR2(45) ,
	CREDIT DECIMAL(8,2) 
) ;
 
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);

CREATE TABLE PLAYERS (
	PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,  
	LAST_NAME VARCHAR2(35) NOT NULL,
	FIRST_NAME VARCHAR2(25) NOT NULL,
	POS VARCHAR2(10) ,
	YEAR_OF_BIRTH NUMBER(38) NOT NULL,
	YEAR_DRAFTED NUMBER(38) NOT NULL
) ;

CREATE TABLE GAMES (
   PLAYER_ID CHAR(8) NOT NULL,
   YEAR_NO      NUMBER(38) NOT NULL,
   TEAM      CHAR(3) NOT NULL,
   WEEK      NUMBER(38) NOT NULL,
   OPPONENT  CHAR(3) ,
   COMPLETES NUMBER(38) ,
   ATTEMPTS  NUMBER(38) ,
   PASSING_YARDS NUMBER(38) ,
   PASSING_TD    NUMBER(38) ,
   INTERCEPTIONS NUMBER(38) ,
   RUSHES NUMBER(38) ,
   RUSH_YARDS NUMBER(38) ,
   RECEPTIONS NUMBER(38) ,
   RECEPTIONS_YARDS NUMBER(38) ,
   TOTAL_TD NUMBER(38) 
) ;

CREATE TABLE PLAYER_SUMMARY  (
		  ID CHAR(8) NOT NULL, 
		  YEAR_NO NUMBER(38) NOT NULL,
		  COMPLETES NUMBER(38) NOT NULL , 
		  ATTEMPTS NUMBER(38) NOT NULL , 
		  PASSING_YARDS NUMBER(38) NOT NULL , 
		  PASSING_TD NUMBER(38) NOT NULL , 
		  INTERCEPTIONS NUMBER(38) NOT NULL , 
		  RUSHES NUMBER(38) NOT NULL , 
		  RUSH_YARDS NUMBER(38) NOT NULL , 
		  RECEPTIONS NUMBER(38) NOT NULL , 
		  RECEPTIONS_YARDS NUMBER(38) NOT NULL , 
		  TOTAL_TD NUMBER(38) NOT NULL
) ;

CREATE TABLE ERROR_LOG  (
		JOB_NAME CHAR(20) ,
		STEP_NAME CHAR(20) ,
		MESSAGE VARCHAR(300) NOT NULL
) ;
