-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurveybuilder.sql
74 lines (58 loc) · 1.16 KB
/
surveybuilder.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- database within which scope will be stored all the tables of SurveyBuilder application
create database surveybuilder;
-- database tables
CREATE TABLE surveys
(
id serial NOT NULL,
name character varying(255),
textareasno integer,
redirection text,
welcome text,
timetofill integer,
);
create table surveyrespondents(
id serial NOT NULL,
surveyid integer,
name varchar(255)
);
-- tables connected with textareas (open questions)
create table textareas(
id serial NOT NULL,
surveyid integer,
questioncontent text
);
create table textareaentries(
id serial NOT NULL,
textareaid integer,
respondendid integer,
answer text
);
-- tables connected with checkboxes
create table checkboxquestions(
id serial NOT NULL,
surveyid integer,
checkboxcontent text
);
create table checkboxoptions(
id serial NOT NULL,
questionid integer,
optioncontent text
);
create table checkboxentries(
id serial NOT NULL,
optionid integer,
respondendid integer,
optionvalue integer
);
-- tables for temporary operations
create table tmpquestions(
name text
);
create table tmpcbquestions(
id serial NOT NULL,
qcontent text
);
create table tmpcboptions(
cbqid integer,
ocontent text
);