connect to testdb user db2local using db2localPW;

CREATE TABLE BOOK (
	 ISBN               DECIMAL(13, 0) DEFAULT 0 NOT NULL
	,AUTHORS            CHAR(40) DEFAULT '' NOT NULL
	,TITLE              CHAR(60) DEFAULT '' NOT NULL
	,PUB_DATE           DATE DEFAULT CURRENT DATE NOT NULL
	,PAGE_NR            DECIMAL(4, 0) DEFAULT 0 NOT NULL
    ,INSERT_USER        CHAR(20) DEFAULT '' NOT NULL
    ,INSERT_TIMESTAMP   TIMESTAMP DEFAULT CURRENT TIMESTAMP NOT NULL
    ,LUPD_USER          CHAR(20) DEFAULT '' NOT NULL
    ,LUPD_TIMESTAMP     TIMESTAMP DEFAULT CURRENT TIMESTAMP NOT NULL
    ,LUPD_COUNTER       DECIMAL(6, 0) DEFAULT 0 NOT NULL
	,PRIMARY KEY (ISBN)
	);

CREATE INDEX BOOKX1 ON BOOK (
	 AUTHORS
	,TITLE
	,ISBN
	);
    
connect reset;
