CREATE TABLE ACTIONSCHEDULEDATA
(	TARGETDATE DATE NOT NULL,
	PERSONCODE NUMERIC(8,0) NOT NULL,
	ACTIONSCHEDULE VARCHAR(30),
	TARGETYEAR NUMERIC(4,0) NOT NULL,
	TARGETMONTH NUMERIC(2,0) NOT NULL,
	TARGETDAY NUMERIC(2,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL,
	 PRIMARY KEY(TARGETDATE, PERSONCODE)
);

CREATE TABLE APPROVALMASTER
(	APPROVALCODE NUMERIC(3,0) NOT NULL,
	DEPARTMENTCODE NUMERIC(5,0) NOT NULL,
	SEQNO NUMERIC(2,0) NOT NULL,
	DISPLAYORDER NUMERIC(2,0) NOT NULL,
	APPROVALPERSON NUMERIC(8,0) NOT NULL,
	APPROVALAUTHORITY NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME,
	 PRIMARY KEY (APPROVALCODE, DEPARTMENTCODE, SEQNO)
);

CREATE TABLE BUSINESSTYPEMASTER
(	BUSINESSTYPECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	BUSINESSTYPENAME VARCHAR(100) DEFAULT '' NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL,
	 PRIMARY KEY (BUSINESSTYPECODE)
);

CREATE TABLE COMMONCOSTLARGE
(	LARGECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	LARGENAME VARCHAR(50) DEFAULT '' NOT NULL,
	COMMENTTEXT VARCHAR(120),
	DELETEFLG NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL,
	 PRIMARY KEY (LARGECODE)
);

CREATE TABLE COMMONCOSTLINKMS 
(	LARGECODE NUMERIC(5,0) NOT NULL, 
	MIDDLECODE NUMERIC(5,0) NOT NULL,
	ITEMCODE NUMERIC(5,0) NOT NULL,
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (LARGECODE, MIDDLECODE, ITEMCODE) 
);

CREATE TABLE COMMONCOSTMIDDLE 
(	LARGECODE NUMERIC(5,0) NOT NULL, 
	MIDDLECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	MIDDLENAME VARCHAR(50) DEFAULT '' NOT NULL, 
	COMMENTTEXT VARCHAR(120),
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (LARGECODE, MIDDLECODE) 
);

CREATE TABLE COMMONCOSTMIDDLESEARCHWORD 
(	LARGECODE NUMERIC(5,0) NOT NULL, 
	MIDDLECODE NUMERIC(5,0) NOT NULL,
	SEQNO NUMERIC(5,0) NOT NULL, 
	SEARCHWORD VARCHAR(50) DEFAULT '' NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (LARGECODE, MIDDLECODE, SEQNO)
);

CREATE TABLE COMPONENTLINKMASTER
(	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPONENTCODE, ITEMCODE) 
);

CREATE TABLE COMPONENTMASTER
(	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	COMPONENTNAME VARCHAR(120) DEFAULT '' NOT NULL, 
	SUBITEMSFLG NUMERIC(1,0), 
	DIRECTINPUTFLG NUMERIC(1,0),
	MYEXPENSESFLG NUMERIC(1,0), 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPONENTCODE) 
);

CREATE TABLE CONSTRUCTIONBASEINFO 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	TYINGFLG NUMERIC(1,0) NOT NULL,
	CONSTRUCTIONYEAR NUMERIC(4,0) NOT NULL,
	CONSTRUCTIONPERIOD NUMERIC(4,0) NOT NULL,
	REQUESTEDDATE DATE,
	ESTIMATESSUBMITDEADLINE DATE,
	ESTIMATESSUBMITTEDDATE DATE, 
	PROVISIONALORDERDATE DATE, 
	ORDERDATE DATE,
	ORDERSTARTINGDATE DATE,
	ORDERCOMPLETIONDATE DATE,
	PREPARATIONSTARTDATE DATE, 
	CONSTRUCTIONSTARTINGDATE DATE, 
	CONSTRUCTIONCOMPLETIONDATE DATE, 
	NONORDERDATE DATE, 
	ORDERSDECISIONPRICE NUMERIC(12,2) NOT NULL,
	ORDERSDECISIONPRICEINTAX NUMERIC(12,2) NOT NULL, 
	SALESPERSONCODE NUMERIC(8,0), 
	CONSTRUCTIONPERSONCODE NUMERIC(8,0) NOT NULL,
	CONSTRSUBPERSONCODE NUMERIC(8,0) NOT NULL, 
	CONSTRUCTIONINSTRUCTOR NUMERIC(8,0) NOT NULL,
	TRANSFERCONSTRUCTION NUMERIC(8,0) NOT NULL,
	TRANSFERCONSTRUCTIONDATE DATE, 
	ORDERERSDIVISION NUMERIC(5,0) NOT NULL,
	ORDERERSCODE NUMERIC(5,0) NOT NULL,
	ESTIMATESEXPIRATIONDATE DATE,
	CONSTRUCTIONPERIODSTART DATE,
	CONSTRUCTIONPERIODEND DATE,
	CONSTRUCTIONPERIODSTART2 DATE, 
	CONSTRUCTIONPERIODEND2 DATE, 
	STARTDATE DATE,
	ENDDATE DATE,
	PURCHASEORDERMAILINGDATE DATE, 
	PURCHASEORDERRETURNDATE DATE,
	PURCHASEORDERRETURNCHECKDATE DATE, 
	CONSUMPTIONTAXFLG NUMERIC(1,0) NOT NULL, 
	PRIMECONTRACTORFLG NUMERIC(1,0) NOT NULL,
	SALESCOSTFLG NUMERIC(1,0) NOT NULL,
	CONSTRUCTIONSTATUSFLG NUMERIC(2,0) NOT NULL, 
	CONSTRUCTIONTYPE NUMERIC(5,0) NOT NULL,
	ESTIMATETYPE NUMERIC(1,0) NOT NULL,
	BILLINGSTARTDATE DATE NOT NULL, 
	BILLINGDATE DATE NOT NULL,
	BILLINGSPLITFLG NUMERIC(1,0) NOT NULL, 
	BILLINGSENDDATE DATE,
	LEDGERCOMPLATEDATE DATE NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE)
);

CREATE TABLE CONSTRUCTIONBASEINFODETAIL 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	DETAILNO NUMERIC(2,0) NOT NULL,
	DETAILSTRING VARCHAR(120), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, DETAILNO)
);

CREATE TABLE CONSTRUCTIONBUDGET 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	CREATORCODE NUMERIC(8,0) NOT NULL, 
	CREATORNAME VARCHAR(60), 
	CREATORCOSTS NUMERIC(11,3) NOT NULL, 
	ASSISTANTCODE NUMERIC(8,0) NOT NULL, 
	ASSISTANTNAME VARCHAR(60), 
	ASSISTANTCOSTS NUMERIC(11,3) NOT NULL, 
	INSTRUCTORCODE NUMERIC(8,0) NOT NULL,
	INSTRUCTORNAME VARCHAR(60),
	INSTRUCTORCOSTS NUMERIC(11,3) NOT NULL,
	CREATEDATE DATE NOT NULL, 
	CONSTRUCTIONTIMES NUMERIC(5,2) NOT NULL, 
	CONSTRUCTIONSTART DATE NOT NULL,
	CONSTRUCTIONEND DATE NOT NULL,
	INSTRUCTORTIMES NUMERIC(5,2) NOT NULL, 
	SALARYFLG NUMERIC(1,0) NOT NULL, 
	SALARYDAYS NUMERIC(4,0) NOT NULL,
	A_SALARYFLG NUMERIC(1,0) NOT NULL, 
	A_SALARYDAYS NUMERIC(4,0) NOT NULL,
	I_SALARYFLG NUMERIC(1,0) NOT NULL, 
	I_SALARYDAYS NUMERIC(4,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE)
);

CREATE TABLE CONSTRUCTIONBUDGETDETAIL 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	GROUPCOUNT NUMERIC(2,0) NOT NULL,
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	FIRSTSTRING VARCHAR(120),
	SECONDSTRING VARCHAR(120), 
	COMPANYTYPE NUMERIC(1,0) NOT NULL, 
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	COMPANYNAME VARCHAR(120),
	ESTIMATEPRICE NUMERIC(12,2) NOT NULL,
	NEGOTIATIONPRICE NUMERIC(12,2) NOT NULL, 
	ORDERDESIREDAMOUNT NUMERIC(12,2) NOT NULL, 
	EXECUTIONAMOUNT NUMERIC(12,2) NOT NULL,
	AMOUNTCONFIGRATE NUMERIC(5,2) NOT NULL,
	NEGOTIATEFLG NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, GROUPCOUNT, LINECOUNT) 
);

CREATE TABLE CONSTRUCTIONITEMMASTER 
(	ITEMCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	ITEMNAME VARCHAR(120) DEFAULT '' NOT NULL,
	SUBITEMSFLG NUMERIC(1,0), 
	MYEXPENSESFLG NUMERIC(1,0) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (ITEMCODE)
);

CREATE TABLE CONSTRUCTIONLEDGER 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	CONSTRUCTIONPERIOD NUMERIC(4,0) NOT NULL,
	CREATORCODE NUMERIC(8,0), 
	CREATORNAME VARCHAR(60), 
	CREATEDATE DATE NOT NULL, 
	CONSTRUCTIONTIMES NUMERIC(5,2) NOT NULL, 
	CONSTRUCTIONSTART DATE NOT NULL,
	CONSTRUCTIONEND DATE NOT NULL,
	ORDERSDECISIONPRICE NUMERIC(14,2) NOT NULL,
	COMPANYEXPENSES NUMERIC(10,2) NOT NULL,
	DEPARTMENTEXPENSES NUMERIC(10,2) NOT NULL, 
	SALESEXPENSES NUMERIC(10,2) NOT NULL,
	TOTALPAYMENT NUMERIC(10,2) NOT NULL, 
	GROSSPROFIT NUMERIC(10,2) NOT NULL,
	ALLOWANCE NUMERIC(10,2) NOT NULL,
	NETPROFIT NUMERIC(10,2) NOT NULL,
	COMPLATEFLG NUMERIC(1,0) NOT NULL, 
	INTEGRATIONFLG NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE)
);

CREATE TABLE CONSTRUCTIONLEDGERDETAIL 
(	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	GROUPCOUNT NUMERIC(2,0) NOT NULL,
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	FIRSTSTRING VARCHAR(120),
	SECONDSTRING VARCHAR(120), 
	COMPANYTYPE NUMERIC(1,0) NOT NULL, 
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	COMPANYNAME VARCHAR(120),
	ESTIMATEPRICE NUMERIC(12,2) NOT NULL,
	EXECUTIONAMOUNT NUMERIC(12,2) NOT NULL,
	AMOUNTCONFIGRATE NUMERIC(5,2) NOT NULL,
	PAYMENTBURDEN NUMERIC(12,2) NOT NULL,
	FIXDATAFLG NUMERIC(1,0) NOT NULL,
	INDEPENDENTFLG NUMERIC(1,0) NOT NULL,
	FLUCTUATIONFLG NUMERIC(1,0) NOT NULL,
	SALARYFLG NUMERIC(1,0) NOT NULL, 
	SALARYDAYS NUMERIC(4,0) NOT NULL,
	OPERATINGFLG NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, GROUPCOUNT, LINECOUNT) 
);

CREATE TABLE CONSTRUCTIONLEDGEREXCUTE 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	GROUPCOUNT NUMERIC(2,0) NOT NULL,
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COLUMNCOUNT NUMERIC(3,0) NOT NULL, 
	PAYMENTAMOUNT NUMERIC(12,2) NOT NULL,
	TARGETMONTH DATE NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, GROUPCOUNT, LINECOUNT, COLUMNCOUNT)
);

CREATE TABLE CONSTRUCTIONLINK 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	FLUCTUATIONCODE NUMERIC(10,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, FLUCTUATIONCODE) 
);

CREATE TABLE CONSTRUCTIONPROGRESSDATE 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	CONSTRUCTIONSTATUSFLG NUMERIC(2,0) NOT NULL, 
	PREVIOUSSTATUSFLG NUMERIC(2,0), 
	CHANGEDATE DATE NOT NULL, 
	CHANGEPERSONCODE NUMERIC(8,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, CONSTRUCTIONSTATUSFLG) 
);

CREATE TABLE CONSTRUCTIONSPECMASTER 
 (	ITEMCODE NUMERIC(5,0) NOT NULL,
	SPECCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	ITEMNAME VARCHAR(120) DEFAULT '',
	SPECNAME VARCHAR(120), 
	UNITNAME VARCHAR(30),
	UNITPRICE NUMERIC(9,2) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (ITEMCODE, SPECCODE)
);

CREATE TABLE CONSTRUCTIONSPECUNITPRICE
 (	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	SPECCODE NUMERIC(5,0) NOT NULL,
	CONSTRUCTIONTYPECODE NUMERIC(5,0) NOT NULL,
	UNITPRICE NUMERIC(9,2) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPONENTCODE, ITEMCODE, SPECCODE, CONSTRUCTIONTYPECODE) 
);

CREATE TABLE CONSTRUCTIONTYPEMASTER 
 (	TYPECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	NAMESTRING VARCHAR(100) DEFAULT '' NOT NULL,
	PUBLICFLG NUMERIC(1,0) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (TYPECODE)
);

CREATE TABLE COSTDATAOFPERSON 
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	ACTIONDATE DATE NOT NULL, 
	DATATYPE NUMERIC(1,0) NOT NULL,
	DATAADDCOUNT NUMERIC(5,0) NOT NULL,
	TARGETMONTH VARCHAR(7) NOT NULL, 
	CONSTRUCTIONCODE NUMERIC(10,0), 
	SUPPLIERSCODE NUMERIC(5,0) NOT NULL, 
	SUPPLIERSNAME VARCHAR(120),
	PAYMENTCONTENT VARCHAR(60),
	PAYMENTTYPE NUMERIC(1,0) NOT NULL, 
	ENTRYPRICE NUMERIC(12,2) NOT NULL, 
	COMPLATEFLG NUMERIC(1,0) NOT NULL, 
	APPROVALFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, ACTIONDATE, DATATYPE, DATAADDCOUNT)
);

CREATE TABLE DAILYDATACONSTRUCTION
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	WEATHER VARCHAR(60), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE) 
);

CREATE TABLE DAILYDATADETAIL
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	JOBCATEGORYCODE NUMERIC(5,0) NOT NULL, 
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	TODAYHEADCOUNT NUMERIC(3,0) NOT NULL,
	TOTALHEADCOUNT NUMERIC(4,0) NOT NULL,
	TODAYWORK VARCHAR(100),
	NEXTDAYWORK VARCHAR(100),
	NEXTDAYHEADCOUNT NUMERIC(3,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE DAILYDATAFIELD 
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	PATROLTIME DATE NOT NULL, 
	CONTENTSTEXT VARCHAR(200), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE DAILYDATAMATERIALS 
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	MATERIALS VARCHAR(100),
	QUANTITY VARCHAR(100), 
	PRODUCTION VARCHAR(100), 
	DELIVERY VARCHAR(100), 
	QUALITYCONTROL VARCHAR(100), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE DAILYDATASUBCONTRACTORS
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	ATTENDEE VARCHAR(100), 
	CONTENTSTEXT VARCHAR(200), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE DAILYDATAVEHICLES
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DAILYDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	MODEL VARCHAR(100),
	PERFORMANCE VARCHAR(100),
	OWNER VARCHAR(100),
	DRIVER VARCHAR(100), 
	STARTWORKINGTIME DATE NOT NULL, 
	ENDWORKINGTIME DATE NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, DAILYDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE DEPARTMENTEXPENSESMASTER 
 (	DEPARTMENTCODE NUMERIC(5,0) NOT NULL,
	EXPENSESPERIOD NUMERIC(4,0) NOT NULL,
	NAMECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	EXPENSESRATIO NUMERIC(4,2) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (DEPARTMENTCODE, EXPENSESPERIOD, NAMECODE)
);

CREATE TABLE DEPARTMENTMASTER 
 (	DEPARTMENTCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	DEPARTMENTSTRING VARCHAR(100) DEFAULT '' NOT NULL,
	ACTIONSCHEDULEFLG NUMERIC(1,0) NOT NULL, 
	STAFFASSIGNFLG NUMERIC(1,0) NOT NULL,
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (DEPARTMENTCODE)
);

CREATE TABLE DIVISIONMASTER 
 (	DIVISIONCODE NUMERIC(5,0) NOT NULL,
	NAMECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	NAMESTRING VARCHAR(100) DEFAULT '' NOT NULL,
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (DIVISIONCODE, NAMECODE)
);

CREATE TABLE ESTIMATEBUDGET 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	CONSTRUCTIONTIME NUMERIC(5,2) NOT NULL,
	INTEGRATEDCODE NUMERIC(8,0) NOT NULL,
	DATACREATEDATE DATE NOT NULL, 
	RETVALUE1 NUMERIC(12,2) NOT NULL,
	RETVALUE2 NUMERIC(12,2) NOT NULL,
	RETVALUE3 NUMERIC(12,2) NOT NULL,
	RETVALUE4 NUMERIC(12,2) NOT NULL,
	RETPERCENT NUMERIC(5,2) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (CONSTRUCTIONCODE)
);

CREATE TABLE ESTIMATEBUDGETDETAIL 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	GROUPCOUNT NUMERIC(2,0) NOT NULL,
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0),
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	FIRSTSTRING VARCHAR(120),
	SECONDSTRING VARCHAR(120), 
	ESTIMATEPRICE NUMERIC(12,2) NOT NULL,
	NEGOTIATIONPRICE NUMERIC(12,2) NOT NULL, 
	NOTES VARCHAR(120),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, GROUPCOUNT, LINECOUNT) 
);

CREATE TABLE ESTIMATEDATA 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COMPONENTCODE NUMERIC(3,0) NOT NULL, 
	FIXEDITEMCODE VARCHAR(1), 
	ITEMNAME VARCHAR(120), 
	WORKNAME VARCHAR(120), 
	PRICEVALUE NUMERIC(14,2) NOT NULL, 
	NOTE VARCHAR(60),
	MYEXPENSESFLG NUMERIC(1,0) NOT NULL, 
	INPUTFLG NUMERIC(1,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, LINECOUNT) 
);

CREATE TABLE ESTIMATEDATABODY 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	PAGECOUNT NUMERIC(4,0) NOT NULL, 
	CATEGORY NUMERIC(1,0) NOT NULL,
	UNIONCOMPONENTCODE NUMERIC(5,0) NOT NULL,
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	SELECTCOMPONENT NUMERIC(5,0) NOT NULL, 
	PAGETITLE VARCHAR(120) NOT NULL,
	DETAILLINECOUNT NUMERIC(3,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, PAGECOUNT) 
);

CREATE TABLE ESTIMATEDATADETAIL 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	PAGECOUNT NUMERIC(4,0) NOT NULL, 
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	DATATYPE NUMERIC(1,0) NOT NULL,
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	SPECCODE NUMERIC(5,0) NOT NULL,
	ITEMNAME VARCHAR(120), 
	SPECNAME VARCHAR(120), 
	UNITCOUNT NUMERIC(8,2) NOT NULL, 
	UNITNAME VARCHAR(30),
	UNITPRICE NUMERIC(9,2) NOT NULL, 
	LINETOTAL NUMERIC(12,2) NOT NULL,
	NOTE VARCHAR(60),
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	MYEXPENSESFLG NUMERIC(1,0) NOT NULL, 
	INPUTFLG NUMERIC(1,0),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, PAGECOUNT, LINECOUNT)
);

CREATE TABLE EXPENSESMASTER 
 (	DIVISIONCODE NUMERIC(5,0) NOT NULL,
	NAMECODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	EXPENSESRATIO NUMERIC(4,2) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (DIVISIONCODE, NAMECODE)
);

CREATE TABLE HOLIDAYCALENDERMASTER
 (	HOLIDAY DATE NOT NULL,
	BUSINESSYEAR NUMERIC(4,0) NOT NULL,
	TARGETMONTH NUMERIC(2,0) NOT NULL, 
	TARGETDAY NUMERIC(2,0) NOT NULL, 
	 PRIMARY KEY (HOLIDAY) 
);

CREATE TABLE INPUTSEARCHLOGDATA 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	USEDPROCESSNO NUMERIC(3,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	DATATYPE NUMERIC(1,0) NOT NULL,
	INPUTCODE NUMERIC(10,0),
	 PRIMARY KEY (CONSTRUCTIONCODE, USEDPROCESSNO, DISPLAYORDER) 
);

CREATE TABLE MESSAGEBOARDDATA 
 (	RECORDNUMBER NUMERIC(6,0) NOT NULL,
	BRANCHNUMBER NUMERIC(3,0) NOT NULL,
	FROMCODE NUMERIC(8,0) NOT NULL,
	FROMNAME VARCHAR(60) NOT NULL,
	MESSAGETITILE VARCHAR(100),
	MESSAGECONTENT VARCHAR(1333) NOT NULL,
	LINKTYPE NUMERIC(2,0) NOT NULL,
	LINKMESSAGE VARCHAR(200),
	LINKCODE VARCHAR(30), 
	WRITINGDATE DATE NOT NULL,
	PERSONCODE NUMERIC(8,0) NOT NULL,
	SHAREFLAG NUMERIC(2,0) NOT NULL, 
	MESSAGECOLOR VARCHAR(8),
	BACKCOLOR VARCHAR(8), 
	MESSAGEFLAG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (RECORDNUMBER, BRANCHNUMBER)
);

CREATE TABLE MESSAGEBOARDTERGET 
 (	RECORDNUMBER NUMERIC(6,0) NOT NULL,
	BRANCHNUMBER NUMERIC(3,0) NOT NULL,
	SEQNUM NUMERIC(3,0) NOT NULL,
	TOCODE NUMERIC(8,0) NOT NULL,
	TONAME VARCHAR(60) NOT NULL,
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (RECORDNUMBER, BRANCHNUMBER, SEQNUM)
);

CREATE TABLE MESSAGEBROWSINGHISTORY 
 (	RECORDNUMBER NUMERIC(6,0) NOT NULL,
	BRANCHNUMBER NUMERIC(3,0) NOT NULL,
	SEQNUM NUMERIC(3,0) NOT NULL,
	BROWSINGCODE NUMERIC(8,0) NOT NULL,
	BROWSINGDATE DATE NOT NULL, 
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (RECORDNUMBER, BRANCHNUMBER, SEQNUM)
);

CREATE TABLE ORDERERSMASTER 
 (	ORDERCOTEGORY NUMERIC(5,0) NOT NULL, 
	ORDERERSCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	CORPORATESTATUSNAME VARCHAR(100),
	CORPORATESTATUSPOINT NUMERIC(1,0),
	ORDERERSNAME1 VARCHAR(60) DEFAULT '' NOT NULL,
	ORDERERSNAME2 VARCHAR(60), 
	ZIPCODE VARCHAR(8), 
	ADDRESS1 VARCHAR(60),
	ADDRESS2 VARCHAR(60) DEFAULT '', 
	ADDRESS3 VARCHAR(60),
	PHONENUMBER VARCHAR(13) DEFAULT '', 
	FAXNUMBER VARCHAR(13) DEFAULT '', 
	NOTE VARCHAR(300) DEFAULT '',
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (ORDERCOTEGORY, ORDERERSCODE) 
);

CREATE TABLE ORDERSPRICEDATA
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	CHANGENO NUMERIC(3,0) NOT NULL,
	CHANGEDATE DATE NOT NULL, 
	CHANGEPERSONCODE NUMERIC(8,0) NOT NULL,
	CHANGEPERSONNAME VARCHAR(60),
	BEFOREVALUE NUMERIC(14,2) NOT NULL,
	BEFOREVALUEINTAX NUMERIC(14,2) NOT NULL, 
	AFTERVALUE NUMERIC(14,2) NOT NULL, 
	AFTERVALUEINTAX NUMERIC(14,2) NOT NULL,
	CHANGECOMMENT VARCHAR(200),
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (CONSTRUCTIONCODE, CHANGENO)
);

CREATE TABLE PERSONINCHARGEMASTER 
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	DISPLAYORDER NUMERIC(8,0) NOT NULL,
	PERSONNAME VARCHAR(60) DEFAULT '' NOT NULL, 
	STARTDATE DATE NOT NULL,
	ENDDATE DATE,
	PASSWORD VARCHAR(16), 
	SECURITYMANAGEMENT NUMERIC(1,0) NOT NULL,
	MSGBACKCOLOR VARCHAR(8),
	DISPLAYSTRING VARCHAR(20), 
	DEPARTMENTCODE NUMERIC(5,0),
	MONTHLYSALARY NUMERIC(11,3) NOT NULL,
	YEARSALARY NUMERIC(12,3) NOT NULL, 
	QUALIFICATION VARCHAR(120),
	SEALPRINTNAME VARCHAR(5),
	EMPLOYEECLASSFLG NUMERIC(1,0) NOT NULL,
	LEDGERFLG NUMERIC(1,0) NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE)
);

CREATE TABLE POINTINGOUTCOMMENT 
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	PROCESSNO NUMERIC(3,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	PAGECOUNT NUMERIC(4,0) NOT NULL, 
	PERSONCODE NUMERIC(8,0) NOT NULL,
	DROWCOLOR VARCHAR(8), 
	COMMENTMESSAGE VARCHAR(1000),
	STARTPOINTX NUMERIC(4,0) NOT NULL, 
	STARTPOINTY NUMERIC(4,0) NOT NULL, 
	CURRENTPOINTX NUMERIC(4,0) NOT NULL, 
	CURRENTPOINTY NUMERIC(4,0) NOT NULL, 
	CURRENTWIDTH NUMERIC(4,0) NOT NULL,
	CURRENTHEIGHT NUMERIC(4,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, PROCESSNO, SEQNO)
);

CREATE TABLE PROCEEDINGSDATA
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	PROCEEDINGSDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	STARTMEETINGTIME DATE NOT NULL, 
	ENDMEETINGTIME DATE NOT NULL, 
	MEETINGPALCE1 VARCHAR(100),
	MEETINGPALCE2 VARCHAR(100),
	MEETINGPALCE3 VARCHAR(100),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, PROCEEDINGSDATADATE, CONSTRUCTIONCODE) 
);

CREATE TABLE PROCEEDINGSDATAATTENDEE
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	PROCEEDINGSDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	DEPARTMENT VARCHAR(100), 
	ATTENDEENAME VARCHAR(100), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, PROCEEDINGSDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE PROCEEDINGSDATADETAIL
 (	PERSONCODE NUMERIC(8,0) NOT NULL,
	PROCEEDINGSDATADATE DATE NOT NULL,
	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	TITILENO NUMERIC(3,0),
	TITILE VARCHAR(100), 
	CONTENTSTEXT VARCHAR(200), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PERSONCODE, PROCEEDINGSDATADATE, CONSTRUCTIONCODE, SEQNO)
);

CREATE TABLE PROCESSAPPROVAL
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	APPROVALCODE NUMERIC(3,0) NOT NULL,
	SEQNO NUMERIC(2,0) NOT NULL, 
	PERSONCODE NUMERIC(8,0) NOT NULL,
	PETITIONAPPROVALDATE DATE NOT NULL, 
	APPROVALLIMITDATES DATE NOT NULL, 
	APPROVALSTATUS NUMERIC(1,0) NOT NULL,
	INPUTCOMMENT VARCHAR(300), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, APPROVALCODE, SEQNO) 
);

CREATE TABLE PURCHASEORDER
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	CREATEDATE DATE, 
	ORDERPRICE NUMERIC(12,2) NOT NULL, 
	LASTROWSTRINGDATE DATE NOT NULL,
	ORDERSHEETTYPE NUMERIC(1,0) NOT NULL,
	PAYMENTTERMS NUMERIC(1,0) NOT NULL,
	CASHRATIO NUMERIC(4,1) NOT NULL, 
	BILLPERIOD NUMERIC(4,0) NOT NULL,
	PREPAYMENTS NUMERIC(1,0) NOT NULL, 
	PREPAYMENTSDAYS NUMERIC(3,0) NOT NULL, 
	PREPAYMENTSPRICE NUMERIC(12,2) NOT NULL, 
	PARTIALPAYMENT NUMERIC(1,0) NOT NULL,
	PARTIALPAYMENTMOUNTH NUMERIC(2,0) NOT NULL,
	PARTIALPAYMENTDAY1 NUMERIC(2,0) NOT NULL,
	PARTIALPAYMENTDAY2 NUMERIC(2,0) NOT NULL,
	PARTIALPAYMENTPRICE NUMERIC(12,2) NOT NULL,
	COMPLETIONPAYMENT NUMERIC(1,0) NOT NULL, 
	COMPLETIONPAYMENTDAYS NUMERIC(3,0) NOT NULL, 
	COMPLETIONPAYMENTPRICE NUMERIC(12,2) NOT NULL, 
	LEADENGINEERCODE NUMERIC(8,0),
	LEADENGINEERNAME VARCHAR(60),
	SAFETYOFFICERCODE NUMERIC(8,0), 
	SAFETYOFFICERNAME VARCHAR(60), 
	WORKERSCOUNT NUMERIC(3,0),
	PRINTOUTDATE DATE NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, SEQNO) 
);

CREATE TABLE PURCHASEORDERDETAIL
 (	CONSTRUCTIONCODE NUMERIC(10,0) NOT NULL, 
	SEQNO NUMERIC(3,0) NOT NULL, 
	GROUPCOUNT NUMERIC(1,0) NOT NULL,
	LINECOUNT NUMERIC(3,0) NOT NULL, 
	COMPONENTCODE NUMERIC(5,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	FIRSTSTRING VARCHAR(120),
	SECONDSTRING VARCHAR(120), 
	UNITCOUNT NUMERIC(8,2) NOT NULL, 
	UNITNAME VARCHAR(30),
	UNITPRICE NUMERIC(10,2) NOT NULL,
	ORDERSLINEPRICE NUMERIC(12,2),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONCODE, SEQNO, GROUPCOUNT, LINECOUNT)
);

CREATE TABLE SALESGRAPHDATA 
 (	GRAPHDATACODE NUMERIC(8,0) NOT NULL, 
	CONSTRUCTIONPERIOD NUMERIC(4,0) NOT NULL,
	SALESDATADAYS DATE NOT NULL,
	DISPLAYORDER NUMERIC(8,0) NOT NULL,
	DATANAME VARCHAR(100) NOT NULL, 
	SALESAMOUNT NUMERIC(10,0) NOT NULL,
	ADMINISTRATIVEEXPENSE NUMERIC(10,0) NOT NULL,
	GROSSPROFIT NUMERIC(10,0) NOT NULL,
	NETINCOME NUMERIC(10,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (GRAPHDATACODE, CONSTRUCTIONPERIOD, SALESDATADAYS)
);

CREATE TABLE SUBCONTRACTORITEMMASTER
 (	ITEMCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	ITEMNAME VARCHAR(120) DEFAULT '' NOT NULL,
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (ITEMCODE)
);

CREATE TABLE SUBCONTRACTORJOBCATEGORY 
 (	JOBCATEGORYCODE NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	JOBCATEGORYNAME VARCHAR(120) DEFAULT '' NOT NULL, 
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (JOBCATEGORYCODE) 
);

CREATE TABLE SUBCONTRACTORJOBITEM 
 (	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	ITEMCODE NUMERIC(5,0) NOT NULL,
	DISPLAYORDER NUMERIC(8,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPANYCODE, ITEMCODE) 
);

CREATE TABLE SUBCONTRACTORJOBLINK 
 (	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	JOBCATEGORYCODE NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(8,0) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPANYCODE, JOBCATEGORYCODE)
);

CREATE TABLE SUBCONTRACTORMASTER
 (	COMPANYCODE NUMERIC(8,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	CORPORATESTATUSNAME VARCHAR(40) DEFAULT '',
	CORPORATESTATUSPOINT NUMERIC(1,0) NOT NULL,
	COMPANYNAME VARCHAR(100) DEFAULT '' NOT NULL, 
	CEOPOSITIONNAME VARCHAR(60) DEFAULT '',
	CEONAME VARCHAR(60) DEFAULT '',
	CONTACTPERSONNAME VARCHAR(60), 
	ZIPCODE VARCHAR(8), 
	ADDRESS1 VARCHAR(60),
	ADDRESS2 VARCHAR(60) DEFAULT '', 
	ADDRESS3 VARCHAR(60),
	CELLPHONENUMBER VARCHAR(13),
	MAILADDRESS VARCHAR(257), 
	PHONENUMBER VARCHAR(13) DEFAULT '', 
	FAXNUMBER VARCHAR(13) DEFAULT '', 
	JAPANESESYLLABARY VARCHAR(2),
	STARTDATE DATE NOT NULL,
	NOTE VARCHAR(300) DEFAULT '',
	LABOURKIND NUMERIC(1,0) NOT NULL,
	DELETEFLG NUMERIC(1,0) DEFAULT 0 NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (COMPANYCODE) 
);

CREATE TABLE SUPPLIERSMASTER
 (	SUPPLIERSCODE NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	SUPPLIERSNAME1 VARCHAR(60) DEFAULT '' NOT NULL, 
	SUPPLIERSNAME2 VARCHAR(60),
	ZIPCODE VARCHAR(8), 
	ADDRESS1 VARCHAR(60),
	ADDRESS2 VARCHAR(60) DEFAULT '', 
	ADDRESS3 VARCHAR(60),
	PHONENUMBER VARCHAR(13) DEFAULT '', 
	FAXNUMBER VARCHAR(13) DEFAULT '', 
	NOTE VARCHAR(300) DEFAULT '',
	DELETEFLG NUMERIC(1,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (SUPPLIERSCODE) 
);

CREATE TABLE SYSTEMEXECUTE
 (	PRIMARYCODE NUMERIC(3,0) NOT NULL, 
	TARGETDATE DATE NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (PRIMARYCODE) 
);

CREATE TABLE SYSTEMMASTER 
 (	SYSTEMCODE NUMERIC(3,0) NOT NULL,
	COMPANYNAME1 VARCHAR(60) DEFAULT '' NOT NULL, 
	COMPANYNAME2 VARCHAR(60) DEFAULT '', 
	CEONAME VARCHAR(60) DEFAULT '' NOT NULL,
	CEOPOSITIONNAME VARCHAR(60) DEFAULT '',
	ZIPCODE VARCHAR(8) NOT NULL, 
	ADDRESS1 VARCHAR(60) NOT NULL,
	ADDRESS2 VARCHAR(60) DEFAULT '', 
	ADDRESS3 VARCHAR(60),
	PHONENUMBER VARCHAR(13) DEFAULT '' NOT NULL, 
	FAXNUMBER VARCHAR(13) DEFAULT '', 
	CONSTRUCTIONEXPENSES NUMERIC(4,2) NOT NULL,
	OFFICEEXPENSES NUMERIC(4,2) NOT NULL,
	OPERATINGEXPENSES NUMERIC(4,2) NOT NULL, 
	CONSUMPTIONTAX NUMERIC(4,2) NOT NULL,
	EXCELSAVEPATH VARCHAR(120),
	BUSINESSPERIOD NUMERIC(4,0) NOT NULL,
	CONSTRUCTIONYEAR NUMERIC(4,0) NOT NULL,
	BUSINESSBEGINNINGDATE VARCHAR(5) NOT NULL, 
	CONSTRUCTIONBEGINNINGDATE VARCHAR(5) NOT NULL, 
	CONSTRUCTIONNOBASE NUMERIC(1,0) NOT NULL,
	SLOGANSTRING1 VARCHAR(100),
	SLOGANSTRING2 VARCHAR(100),
	SLOGANSTRING3 VARCHAR(100),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (SYSTEMCODE)
);

CREATE TABLE TERMMASTER 
 (	CONSTRUCTIONSTATUSFLG NUMERIC(2,0) NOT NULL, 
	FIELDNO NUMERIC(2,0) NOT NULL, 
	SEQNO NUMERIC(2,0) NOT NULL, 
	DISPLAYORDER NUMERIC(2,0) NOT NULL,
	CHECKSCHDULE NUMERIC(1,0) NOT NULL,
	TERMDAYS NUMERIC(3,0) NOT NULL,
	SENDTITILE VARCHAR(100), 
	SENDMESSAGE VARCHAR(100),
	BACKCOLOR VARCHAR(8), 
	FORECOLOR VARCHAR(8), 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (CONSTRUCTIONSTATUSFLG, FIELDNO, SEQNO) 
);

CREATE TABLE UNITMASTER 
 (	UNITKEY NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	UNITNAME VARCHAR(30) NOT NULL,
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (UNITKEY) 
);

CREATE TABLE VEHICLEMASTER
 (	VEHICLECODE NUMERIC(5,0) NOT NULL, 
	DISPLAYORDER NUMERIC(5,0) NOT NULL,
	VEHICLENAME VARCHAR(100) NOT NULL,
	REGISTRATIONNUMBER VARCHAR(30),
	IDENTIFICATIONNUMBER VARCHAR(30),
	MODELCODE VARCHAR(30), 
	DEPARTMENTCODE NUMERIC(5,0) NOT NULL,
	VEHICLESCHEDULEFLG NUMERIC(1,0) NOT NULL,
	PURCHASEDATE DATE, 
	PURCHASENAME VARCHAR(30),
	PURCHASECONTACTPERSONS VARCHAR(30),
	PURCHASEPHONE VARCHAR(13),
	LEASEDATE DATE,
	LEASEDESTINATION VARCHAR(30),
	LEASECONTACTPERSONS VARCHAR(30), 
	LEASEPHONE VARCHAR(13), 
	INSURANCECOMPANY VARCHAR(30),
	INSURANCECONTACTPERSONS VARCHAR(30), 
	INSURANCEPHONE VARCHAR(13),
	NOTE VARCHAR(300), 
	ENTRYDATE DATETIME,
	UPDATEDATE DATETIME, 
	 PRIMARY KEY (VEHICLECODE) 
);

CREATE TABLE VEHICLERECORDDATA
 (	VEHICLECODE NUMERIC(5,0) NOT NULL, 
	DIVISIONCODE NUMERIC(2,0) NOT NULL,
	SEQNO NUMERIC(3,0) NOT NULL, 
	RECORDDATE DATE, 
	MILEAGE NUMERIC(7,0), 
	CONTENT VARCHAR(100),
	PAYMENTCOST NUMERIC(10,2),
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (VEHICLECODE, DIVISIONCODE, SEQNO)
);

CREATE TABLE VEHICLESCHEDULEDATA
( TARGETDATE DATE NOT NULL, 
	VEHICLECODE NUMERIC(5,0) NOT NULL, 
	MORNINGAFTERNOON NUMERIC(1,0) NOT NULL,
	PERSONCODE NUMERIC(8,0) NOT NULL,
	TARGETYEAR NUMERIC(4,0) NOT NULL,
	TARGETMONTH NUMERIC(2,0) NOT NULL, 
	TARGETDAY NUMERIC(2,0) NOT NULL, 
	ENTRYDATE DATETIME NOT NULL,
	UPDATEDATE DATETIME NOT NULL, 
	 PRIMARY KEY (TARGETDATE, VEHICLECODE, MORNINGAFTERNOON) 
);

