CREATE TABLE State (
    stateID    SMALLINT not NULL
,   abbrev     CHAR(2)   not NULL
);


CREATE TABLE County (
    stateID     SMALLINT       not NULL
,   countyID    SMALLINT       not NULL
,   name       VARCHAR(40)
);


CREATE TABLE CFCC (
    CFCC         VARCHAR(3) not NULL
,   description  VARCHAR(220) not NULL
);


CREATE TABLE Point (
    TZID      INTEGER
,   coord     POINT
);


CREATE TABLE Chain (
    TLID      INTEGER  not NULL
,   CFCC      VARCHAR(3) not NULL
,   TZIDS     INTEGER  not NULL   -- starting point
,   TZIDE     INTEGER  not NULL   -- ending point
);


CREATE TABLE ChainThroughCounty(
    TLID      INTEGER not NULL
,   stateID   SMALLINT not NULL
,   countyID  SMALLINT not NULL
);


CREATE TABLE Feature (
    stateID     SMALLINT  not NULL
,   countyID    SMALLINT  not NULL
,   featID      INTEGER  not NULL
,   Name        VARCHAR(31)
,   Prefix  VARCHAR(2)
,   Type    VARCHAR(4)
,   Suffix  VARCHAR(2)
);

CREATE TABLE ChainName (
    stateID     SMALLINT  not NULL
,   countyID    SMALLINT  not NULL
,   featID      INTEGER   not NULL
,   TLID        INTEGER   not NULL
);

CREATE TABLE AddressRange (
    TLID        INTEGER  not NULL
,   seq         SMALLINT not NULL
,   orientation CHAR(1)     not NULL
,   fraddr      VARCHAR(11)
,   toaddr      VARCHAR(11)
,   zip         INTEGER
,   zipplus     SMALLINT
);
