CREATE TABLE num (
    adsh      VARCHAR(255),
    tag       VARCHAR(255),
    version   VARCHAR(255),
    coreg     VARCHAR(255),
    ddate     BIGINT,
    qtrs      BIGINT,
    uom       VARCHAR(50),
    value     DOUBLE PRECISION,
    footnote  TEXT      
);

CREATE TABLE pre (
    adsh      VARCHAR(255),
    report    BIGINT,
    line      BIGINT,
    stmt      VARCHAR(255),
    inpth     BIGINT,
    rfile     VARCHAR(255),
    tag       VARCHAR(255),
    version   VARCHAR(255),
    plabel    VARCHAR(255),
    negating  BIGINT
);

CREATE TABLE sub (
    adsh        VARCHAR(255),
    cik         BIGINT,
    name        VARCHAR(255),
    sic         DOUBLE PRECISION,
    countryba   VARCHAR(100),
    stprba      VARCHAR(100),
    cityba      VARCHAR(255),
    zipba       VARCHAR(50),
    bas1        VARCHAR(255),
    bas2        VARCHAR(255),
    baph        VARCHAR(255),
    countryma   VARCHAR(100),
    stprma      VARCHAR(100),
    cityma      VARCHAR(255),
    zipma       VARCHAR(50),
    mas1        VARCHAR(255),
    mas2        VARCHAR(255),
    countryinc  VARCHAR(100),
    stprinc     VARCHAR(100),
    ein         BIGINT,
    former      VARCHAR(255),
    changed     DOUBLE PRECISION,
    afs         VARCHAR(255),
    wksi        BIGINT,
    fye         DOUBLE PRECISION,
    form        VARCHAR(50),
    period      DOUBLE PRECISION,
    fy          DOUBLE PRECISION,
    fp          VARCHAR(50),
    filed       BIGINT,
    accepted    VARCHAR(255),
    prevrpt     BIGINT,
    detail      BIGINT,
    instance    VARCHAR(255),
    nciks       BIGINT,
    aciks       VARCHAR(255)
);

CREATE TABLE tag (
    tag       VARCHAR(255),
    version   VARCHAR(255),
    custom    BIGINT,
    abstract  BIGINT,
    datatype  VARCHAR(255),
    iord      VARCHAR(50),
    crdr      VARCHAR(50),
    tlabel    VARCHAR(255),
    doc       TEXT
);