CREATE TABLE Actions (
        ActionSeq       NUMBER(10) NOT NULL, 
        ActionName      VARCHAR2(20) NOT NULL, 
        PRIMARY KEY (ActionSeq));

CREATE TABLE AuditEvent (
        AuditEventSeq       NUMBER(10) NOT NULL, 
        AuditEventName      VARCHAR2(20) NOT NULL,
        PRIMARY KEY (AuditEventSeq) );

CREATE TABLE Config (
        Parameter           VARCHAR2(20) NOT NULL, 
        pValue              VARCHAR2(20), 
        PRIMARY KEY(Parameter)); 

CREATE TABLE DeferredTaxCategories (
        DefTaxCategoriesSeq NUMBER(10) NOT NULL, 
        CategoryName        VARCHAR2(50),  
        PRIMARY KEY(DefTaxCategoriesSeq));

CREATE TABLE User (
        UserSeq             NUMBER(10) NOT NULL, 
        UserID              CHAR(6) NOT NULL, 
        FirstName           VARCHAR2(20), 
        LastName            VARCHAR2(30), 
        PhoneNumber         VARCHAR2(30), 
        FaxNumber           VARCHAR2(30), 
        Email               VARCHAR2(50), 
        Active              NUMBER(1) DEFAULT 1 NOT NULL,
        PRIMARY KEY (UserSeq));
		
CREATE TABLE ForeignEntity (
        ForeignEntitySeq    NUMBER(10) NOT NULL, 
        TBC                 NUMBER(10) NOT NULL, 
        SubsidiaryName      VARCHAR2(50), 
        Active              NUMBER(1) DEFAULT 1 NOT NULL,
        PRIMARY KEY(ForeignEntitySeq)) ;

CREATE TABLE Objects (
        ObjectSeq           NUMBER(10) NOT NULL,
        ObjectName          VARCHAR2(30) NOT NULL, 
        PRIMARY KEY(ObjectSeq));

CREATE TABLE Schedule20 (
        Schedule20Seq               NUMBER(10) NOT NULL PRIMARY KEY, 
        ForeignEntitySeq            NUMBER(10) NOT NULL, 
        ScheduleYear                NUMBER(10) NOT NULL, 
        TaxRate                     NUMBER(2, 4) DEFAULT 0 NOT NULL, 
        TotalLoss                   NUMBER(12) DEFAULT 0 NOT NULL, 
        TotalTaxEffect              NUMBER(12) DEFAULT 0 NOT NULL, 
        TotalDeferredTaxes          NUMBER(12) DEFAULT 0 NOT NULL, 
        TotalValuationRequired      NUMBER(12) DEFAULT 0 NOT NULL, 
        TotalValuationRecorded      NUMBER(12) DEFAULT 0 NOT NULL, 
        CarrybacksCarrybacksYN      NUMBER(1) DEFAULT 0 NOT NULL, 
        CarrybackScheduleYears      NUMBER(4), 
        CarryforwardsCarrybacksYN   NUMBER(1) DEFAULT 0 NOT NULL, 
        CarryforwardScheduleYears   NUMBER(4), 
        Status                      NUMBER(1) DEFAULT 1 NOT NULL, 
        FOREIGN    KEY   (ForeignEntitySeq)   REFERENCES   ForeignEntity   (ForeignEntitySeq)  );   