drop table if exists drawing_data;
drop table if exists draw_stats;
drop table if exists mega_stats;
commit;

create table drawing_data
(
    draw_dt     date    not null,
    no_1        int     not null,
    no_2        int     not null,
    no_3        int     not null,
    no_4        int     not null,
    no_5        int     not null,
    mega_no     int     not null,
    primary key k0 (draw_dt)
);

create table draw_stats
(
    elm_no          int     not null,
    hit_count       int     not null,
    last_draw_no    int     not null,
    since_last      int     not null,
    curr_seq        int     not null,
    longest_seq     int     not null,
    pct_hits        double  not null,
    max_btwn        int     not null,
    ave_btwn        double  not null,
    primary key k0 (elm_no)
);


create table mega_stats
(
    elm_no          int     not null,
    hit_count       int     not null,
    last_draw_no    int     not null,
    since_last      int     not null,
    curr_seq        int     not null,
    longest_seq     int     not null,
    pct_hits        double  not null,
    max_btwn        int     not null,
    ave_btwn        double  not null,
    primary key k0 (elm_no)
);

commit;

