1 DROP TABLE IF EXISTS people;
3 id INT NOT NULL auto_increment,
4 name VARCHAR(255) NULL DEFAULT NULL,
5 phone_number VARCHAR(255) NOT NULL,
9 DROP TABLE IF EXISTS questionaires;
10 CREATE TABLE questionaires (
11 id INT NOT NULL auto_increment,
12 code VARCHAR(100) NOT NULL, -- always a letter
13 description VARCHAR(255) NOT NULL,
17 DROP TABLE IF EXISTS questions;
18 CREATE TABLE questions (
19 id INT NOT NULL auto_increment,
20 questionaire_id INT NOT NULL,
21 code VARCHAR(100) NOT NULL , -- always a number
22 longdesc VARCHAR(255) NULL DEFAULT NULL,
23 shortdesc VARCHAR(20) NULL DEFAULT NULL,
24 datatype VARCHAR(100) NOT NULL, -- number, char, bool
28 DROP TABLE IF EXISTS answers;
29 CREATE TABLE answers (
30 id INT NOT NULL auto_increment,
31 question_id INT NOT NULL,
32 person_id INT NOT NULL,
33 answer VARCHAR(255) NOT NULL,
34 recieved TIMESTAMP NOT NULL DEFAULT NOW(),
38 -- add group table in the future