db.sql (595B)
1 create table if not exists users ( 2 name text not null unique, 3 email text not null unique, 4 password text not null 5 ); 6 7 create table if not exists answers ( 8 name text not null, 9 round integer not null, 10 problem integer not null, 11 content text, 12 correct real default 0.0, 13 unique(name, round, problem), 14 foreign key (name) references users(name) on delete cascade on update cascade 15 ); 16 17 create table if not exists results ( 18 name text not null, 19 round integer not null, 20 score real not null, 21 unique(name, round), 22 foreign key (name) references users(name) on delete cascade on update cascade 23 );