-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
442 lines (420 loc) · 17.3 KB
/
database.sql
File metadata and controls
442 lines (420 loc) · 17.3 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
CREATE TABLE "user" (
"id" SERIAL PRIMARY KEY,
"username" VARCHAR(255) NOT NULL UNIQUE,
"password" VARCHAR(255),
"firstName" VARCHAR(255),
"lastName" VARCHAR(255),
"email" VARCHAR(255),
"key" VARCHAR(255),
"profile_pic" VARCHAR
);
CREATE TABLE "questions" (
"id" SERIAL PRIMARY KEY,
"question" VARCHAR(255) UNIQUE,
"placeholder" VARCHAR(255)
);
-- Make sure, for the user's answer, to use toLowerCase()/toUpperCase() so the answer is the same for everyone
INSERT INTO "questions" ("question","placeholder")
VALUES
('Hair color?', 'black/brown/red/white/blonde/etc'),
('Eye color?', 'black/hazel/brown/red/blue/green/etc'),
('Height', '5''9'),
('Weight', '165lbs'),
('Race', 'caucasian/white/black/african american/asian/hawaiian/etc.'),
('Gender', 'male/female/other'),
('Age', '55'),
('How many dogs do you own?','0'),
('How many cats do you own?','18'),
('How many allergies do you have?','4'),
('Shoe size', '10.5'),
('Favorite color', 'blue/red/green/blue/white/black/etc.'),
('State you grew up in', 'MN/CA/CO/etc.'),
('City you grew up in', 'Pine City'),
('What age did you first experience trauama?', '6'),
('Have you ever been in love?', 'no/yes'),
('How many children do you have?', '0'),
('Do you drink soda regularly?', 'no/yes'),
('Do you eat fast food regularly?', 'no/yes'),
('How many days per week do you exercise?', '7'),
('How many years older is your father than you?', '25'),
('How many years older is your mother than you?', '26'),
('How many siblings do you have?', '2'),
('Do you have more brothers or sisters?', 'brothers/sisters/none'),
('Do you consider yourself healthy?', 'no/yes'),
('How many years has it been since you have went on vacation?','3'),
('Are you an introvert, extrovert, or somehwere inbetwen?','introvert/extrovert/inbetween'),
('Are you able to focus easily on the task at hand?', 'no/yes/sometimes'),
('Would you call your childhood great, ok, or awful?','great/ok/awful'),
('Do social situations make you anxious?', 'no/yes/rarely/often'),
('Have you ever broken a limb?', 'no/yes'),
('How many concussions have you had?', '5'),
('Does it usually take you longer than an hour to fall asleep?', 'no/yes'),
('During your life, does it usually take you longer than an hour to fall asleep?','no/yes'),
('Would you consider your vision to be good,bad,or ok?', 'good/bad/ok'),
('Would you consider your sense of smell to be good or bad?', 'good/bad'),
('Do you often experience brain fogginess?', 'no/yes'),
('Does your family have a history of mental illness?', 'no/yes'),
('Does your family have a history of addiction?', 'no/yes'),
('Does your family have a history of heart issues?', 'no/yes'),
('Does your family have a history of diabetes?', 'no/yes'),
('Do any of your immediate family members have autism, down syndrome, or a serious mental illness?','no/yes'),
('Do any of your immediate family members struggle with obesity?', 'no/yes'),
('Do any of your immediate family members struggle with bulimia?', 'no/yes'),
('Do you suffer from obesity/unhealthy excess weight?', 'no/yes'),
('Do you suffer from bulimia or dietary/eating problems?', 'no/yes'),
('Do you often feel as if you have something mentally wrong with you, but you can not tell what it is?', 'no/yes'),
('Do you often feel as if you have something physically wrong with you, but you can not tell what it is?', 'no/yes'),
('Have you ever had a serious infection?', 'no/yes'),
('Do you often dream?', 'no/yes'),
('Do you often have nightmares?', 'no/yes'),
('How many days per week do you drink alcohol?', '5'),
('How many days per week do you smoke cigarrettes/vape?','7'),
('How many days per week do you smoke marijuana?', '4'),
('How many days per week do you drink caffeine?', '7'),
('Does your weight often fluctuate greatly?', 'no/yes'),
('What is your dominant hand?', 'left/right/ambidextrous'),
('Have you ever taken any psychadellic substances, aside from marijuanna?', 'no/yes'),
('How many times have you taken psychadellic substances in your life?','48'),
('What age did you first ingest a psychadellic substance?','2'),
('Do you often feel an unhealthy amount of stress?', 'no/yes'),
('How many years(if any) have you felt an unhealthy amount of stress in your life?', '22'),
('Did you grow up lower, middle, or upper class?', 'lower/middle/upper'),
('Did you feel loved by your parent(s)?', 'no/yes'),
('Have you ever served in the armed forces?','no/yes'),
('Have you ever seen someone killed?', 'no/yes'),
('Have you ever been in a coma?', 'no/yes'),
('Have you ever had surgery?', 'no/yes'),
('Have you ever had brain surgery?', 'no/yes'),
('Have you ever had heart surgery?', 'no/yes'),
('Do you sleep on your side, back, or stomach?', 'side/back/stomach'),
('How many hours of sleep do get per night on average?', '4'),
('Have you ever been in a major car accident?', 'no/yes'),
('Would you consider yourself an impulsive person?', 'no/yes'),
('Would you consider yourself an ambitious person?', 'no/yes'),
('Would you consider yourself a lazy person?', 'no/yes'),
('Are you empathetic, not empathetic, or neutral?', 'empathetic/not empathetic/neutral'),
('Are you an optimist, pessimist, or realist?', 'optimist/pessimist/realist'),
('Do you chew your fingernails?', 'no/yes'),
('Do you have trouble making eye contact?', 'no/yes'),
('Do you often have chronically dry eyes?', 'no/yes'),
('Have you ever been shot or stabbed?', 'no/yes'),
('As a child, did you become sick or ill more often than your peers?', 'no/yes'),
('What is your occupation?', 'construction/nurse/waiter/fastfood/biologist/truck driver/etc.'),
('How many hours do you work per week on average?', '10/20/30/40/etc'),
('How many years, if any, have you worked at your current occupation?', '4'),
('What is the most amount of years you have stayed at a single job?','15'),
('How many sexual partners have you had?', '7'),
('Do you currently have what you feel is a healthy living situation?', 'no/yes'),
('As a kid, did you feel you had a healthy living situation?', 'no/yes'),
('In the past or now, are you frequented by unexplained hives or rashes?', 'no/yes'),
('How many days per week do you have headaches/migraines?', '2'),
('Do you often have a stuffy or congested nose?', 'no/yes'),
('What age do you have your earliest childhood memory of?', '67'),
('What state do you currently live in','MN/CA/CO/etc.'),
('What city do you currently live in','Ham Lake'),
('What hospital were you born in?', 'St Judes,MN/not sure'),
('Did you drink mostly well water or mostly city water growing up?', 'well/city'),
('Have you ever been sexually abused?', 'no/yes'),
('Do you consider yourself happy?', 'no/yes'),
('What was your highschool GPA?', '3.25'),
('Did you go to college?', 'no/yes'),
('What was your college GPA?', '3.25'),
('Do you identify as religious?', 'no/yes'),
('How many sports did you play growing up?', '8'),
('How many contact sports did you play growing up?', '4'),
('Are the majority of your immediate family members tall, short, or average?','tall/short/average'),
('How many times have you been diagnosed with covid-19?', '2'),
('Have you ever inhaled a toxic substance?', 'no/yes'),
('Have you ever lived near a place that used pesticides?', 'no/yes'),
('Is your long term memory awful, average, or great?','awful/average/great'),
('Is your short term memory awful, average, or great?', 'awful/average/great'),
('Have you ever been bitten by an animal to the point that blood was drawn?', 'no/yes'),
('Are you diagnosed with bipolar or schizophrenia?', 'no/yes'),
('If diagnosed with bipolar or schizophrenia, how many years have you been diagnosed for?', '0'),
('Do you have any form of sexual dysfunction?', 'no/yes'),
('As a kid, did you ever witness domestic violence?', 'no/yes'),
('As a kid, did you feel safe in your home?', 'no/yes'),
('As a kid, were you bullied?', 'no/yes'),
('As a kid, did you feel as if your family neglected you?', 'no/yes'),
('As a kid, did you ever have a serious illness or accident?', 'no/yes'),
('Do you often get caught in negative cyclical thought patterns that are hard to get out of?', 'no/yes'),
('Was it easy or hard for you to make friends growing up?', 'easy/hard'),
('What age, if any, did you first smoke a cigarrette?', '93'),
('What age, if any,did you have your first drink of alcohol?', '94'),
('What age, if any, did you first smoke marijuanna?', '95'),
('To the best of your knowledge, do you have big chunks of memory missing?', 'no/yes'),
('Did your parents smoke cigarrettes near you when you were a child?','no/yes'),
('Did your parents smoke inside the house?', 'no/yes'),
('Were your parents violent?', 'no/yes'),
('Were your parents emotionally neglectful or abusive?', 'no/yes'),
('Are you a morning or night person?', 'morning/night'),
('What age, if any, did you have you first cup of coffee?', '2'),
('Please list anything else you would like to add that you think may be relevant', 'Please try to keep this as short as possible');
CREATE TABLE "answers" (
"id" SERIAL PRIMARY KEY,
"questions_id" INT REFERENCES questions(id),
"answer" VARCHAR(255),
"user_id" INT REFERENCES "user"("id"),
CONSTRAINT question_user_id UNIQUE("questions_id", "user_id")
);
-------------------------------------------------------------
CREATE TABLE "conditions" (
"id" SERIAL PRIMARY KEY,
"name" VARCHAR(255),
"access_key" VARCHAR(255)
);
INSERT INTO "conditions" ("name","access_key")
VALUES
('allergies', 'fjd73'),
('asthma', '83jf7'),
('adrenocortical carcinoma','9d8ej'),
('alzheimers', '38d8s'),
('alopecia', 'aldue'),
('ankylosing spondylitis','10001' ),
('amyotrophic lateral sclerosis(ALS)', 'd03od' ),
('arthritis', 'f8fsh' ),
('ataxia', '162hd' ),
('bipolar 1', '03od7' ),
('bipolar 2', '3hsua' ),
('cerebral amyloid angiopathy', 'd3io2' ),
('chronic kidney disease', '85kds' ),
('common cold', '0ppo9' ),
('creutzfeldt-jakob disease', '93838' ),
('crohns disease', 'dkah1' ),
('coeliac disease', '47fhv' ),
('cystic fibrosis', 'a3kd9' ),
('dengue', '3748x' ),
('depression', '8u8u9' ),
('desmoplastic small-round-cell-tumor', '3f3f6' ),
('diabetes type 1', '7g7gr' ),
('diabetes type 2', '1g1g3' ),
('dupuytrens disease', 'a8392' ),
('epilepsy', '09873' ),
('ehlers-danlos syndrome', '12349' ),
('fatal familial insomnia', 'lll39' ),
('fibrodysplasia ossificans progressiva', 'aaa8f' ),
('fluoroquinolone toxicity syndrome', 'eeerh' ),
('fibromyalgia', 'oodoo' ),
('gastroparesis', '89ei1' ),
('graves disease', '9090a' ),
('hearing loss', 'lkjhg' ),
('HLH', 'asdfg' ),
('hepatitis B', 'ikmki' ),
('hereditary multiple exostoses', 'ujnju' ),
('herpes simplex', 'yhbhy' ),
('HIV/AIDS', 'tgvgt' ),
('huntingtons disease', 'rfcfr' ),
('hydrocephalus', 'edcde' ),
('interstitial cystitis', 'edxde' ),
('irritable bowel syndrome', 'wszsw' ),
('immune thrombocytopenia', 'qazaq' ),
('joint pain', 'mkokm' ),
('leukemia', 'mnhth' ),
('lichen planus', 'mnbvf' ),
('lymphedema', 'njiko' ),
('macular degeneration', 'njhuy' ),
('marburg virus', 'njhgb' ),
('multiple sclerosis', 'nbvcx' ),
('muscular dystrophy', 'nbgtr' ),
('myasthenia gravis', 'nbgfa' ),
('norovirus', 'vbnmj' ),
('naegleria fowleri', 'vghjy' ),
('narcolepsy', 'vgftr' ),
('osteoporosis', 'vfgre' ),
('osteogenesis imperfecta', 'vfdsq' ),
('parkinsons disease', 'vqwed' ),
('paraphilia disorder', 'cvbgf' ),
('pityriasis rubra pilaris', 'cvbfe' ),
('prion disease(mad cow disease)', 'cgyte' ),
('progeria', 'cdedc' ),
('polio', 'cfrfc' ),
('polycustic ovary sundrome', 'cxsws' ),
('pre-eclampsia', 'cxzaq' ),
('psoriasis', 'caqaq' ),
('pulmonary hypertension', 'qazaq' ),
('pulmonary fibrosis', 'qaswe' ),
('postural orthostatic tachycardia syndrome', 'qsdsq' ),
('rabies', 'qdgjl'),
('retinitis pigmentosa', 'qwewq' ),
('rett syndrome', 'wszas' ),
('rheumatoid arthritis', 'wsdew' ),
('schizophrenia', 'wsdf0' ),
('scleroderma', 'edxde' ),
('scoliosis', 'edcfe' ),
('spinocerebellar ataxia', 'ertue' ),
('severe acute respiratory syndrome', 'epoiu' ),
('systemic lupus erythematosus', 'rfcfr' ),
('trigeminal neuralgia', 'rfvfr' ),
('toxoplasmosis', 'rgvfr' ),
('tinnitus', 'rtghu' ),
('ulcerative colitis', 'rutyr' ),
('urethral stricture', 'tgvgt' ),
('xeroderma pigmentosum', 'tgbgt' ),
('anxiety', 'thnht' ),
('post-traumatic stress disorder', 'thyut' ),
('eating disorders', 'thjkt' ),
('autism', 'yhbhy' ),
('ADHD', 'yhnhy' ),
('ADD', 'yujhy' ),
('OCD', 'yyyhy' ),
('bronchitis', 'yjklk' ),
('hepatitis A', 'ujnju' ),
('astigmatism', 'ujmju' ),
('hepatitis C', 'uklku' ),
('hepatitis D', 'uhghu' ),
('hepatitis E', 'uiopo' ),
('Lung cancer', 'uuuur' ),
('beriberi', 'ijnji' ),
('brain tumor', 'ijmji' ),
('carpal tunnel syndrome', 'ikmki' ),
('chagas disease', 'iklki' ),
('chickenpox', 'iopoi' ),
('chlamydia', 'iiiop' ),
('colorectal cancer', 'iooop' ),
('congestive heart disease', 'swqas' ),
('coronary heart disease', 'sweds' ),
('dementia', 'sxcds' ),
('downs syndrome', 'sxzas' ),
('guillain-barre sybdrome', 'dxsaw' ),
('thyroid disease', 'dewqa' ),
('measles', 'dertf' ),
('mononucleosis', 'drtgf' ),
('mumps', 'dcvfd' ),
('nasal polyps', 'fredf' ),
('obesity', 'frtgf' ),
('paratyphoid fever', 'fdcvf' ),
('pericarditis', 'fgvcf' ),
('peritonitis', 'gtrfg' ),
('pinguecula', 'gvcfg' ),
('pneumonia', 'gtyhg' ),
('porphyria', 'gbnhg' ),
('puerperal sepsis', 'hytgh' ),
('ques fever', 'hgbnh' ),
('rheumatism', 'hyujh' ),
('rift valley fever', 'hjnbg' ),
('sarcoidosis', 'hkgl8' ),
('scarlet fever', 'juyhj' ),
('scrapie', 'jnbhj' ),
('scurvy', 'juikj' ),
('sepsis', 'jnmkj' ),
('shin splints', 'kiujk' ),
('sickle-cell anemia', 'kjnmk' ),
('stomach ulcer', 'kmlok' ),
('strep throat', 'f82fh' ),
('syphilis', 'kolk1' ),
('taeniasis', 'qpalc' ),
('tay-sachs disease', 'wosld' ),
('trachoma', 'rifjg' ),
('trichinosis', 'tyfjs' ),
('tularemia', 'zmsjr' ),
('turners syndrome', 'vbdfj' ),
('varicose veins', '1p2p3' ),
('vitiligo', '1o2o2' ),
('warkany syndrome', '1i1i1' ),
('warts', '1u1u1' ),
('yellow fever', '1t1t1' ),
('zika virus disease', '1r1r1' ),
('lactose intolerance', '1e1e1' ),
('peanut allergy', '3m3m3' ),
('cat allergy', '3k3k3' ),
('dog allergy', '3l3l3' ),
('seasonal allergies', '3p3p3' ),
('brain cancer', '3y3y3' ),
('blood cancer', '3t3t3' ),
('breast cancer', '3r3r3' ),
('cervical cancer', '3f3f3' ),
('stomach cancer', '3d3d3' ),
('esophageal cancer', '3s3s3' ),
('head cancer', '3a3a3' ),
('neck cancer', '4b4b4' ),
('kidney cancer', '4n4n4' ),
('lung cancer', '4p4p4' ),
('matastatic cancer', '4o4o4' ),
('ovarian cancer', 'i4i4i' ),
('pancreatic cancer', '4u4u4' ),
('prostate cancer', '4r4r4' ),
('sarcoma', '4s4s4' ),
('skin cancer', '4a4a4' ),
('testicular cancer', '5p5p5' ),
('thyroid cancer', '5o5o5' ),
('uterine cancer', '5i5i5' ),
('cirrhosis', '5u5u5' ),
('end-stage renal disease', '5y5y5' ),
('moyamoya disease', '5t5t5' ),
('glioma', '5r5r5' ),
('heart arrhythmia', '5e5e5' ),
('heart valve disease', '5l5l5' ),
('acid reflux', '5k5k5' ),
('shingles', '5j5j5' ),
('kidney stones', '5h5h5' ),
('bone spurs', '5g5g5' ),
('brain aneurysm', '5f5f5' ),
('bruxism', '5d5d5' ),
('tourette syndrome', '5s5s5' ),
('catatonia', '5m5m5' ),
('body dysmorphia', '5n5n5' ),
('eczema(atopic dermatitis)', '5b5b5' ),
('agoraphobia', '5v5v5' ),
('panic disorder', '5c5c5' ),
('lip cancer', '5x5x5' ),
('liver cancer', '5z5z5' ),
('mouth cancer', '6p6p6' ),
('chronic cough', '6o6o6' ),
('chronic hives', '6i6i6' ),
('compulsive gambling', '6u6u6' ),
('alcohol addiction', '6y6y6' ),
('heroin addiciton', '6t6t6' ),
('methamphetamine addiction', '7p7p7' ),
('coronavirus', '7o7o7' ),
('COPD', '7i7i7' ),
('cushing syndrome', '7u7u7' ),
('cyclic vomiting syndrome', '7y7y7' ),
('bartholins cyst', '7t7t7' ),
('ganglion cyst', '7l7l7' ),
('kidney cyst', '7k7k7' ),
('ovarian cyst', '7j7j7' ),
('pancreatic cyst', '7g7g7' ),
('pilonidal cyst', '7m7m7' ),
('spermatic cyst', '7n7n7' ),
('sebaceous cyst', '7b7b7' ),
('interstitial cyst', '7v7v7' ),
('chronic dry eyes', '7c7c7' ),
('dyslexia', '8p8p8' ),
('edema', '8o8o8' ),
('eisenmenger syndrome', '8i8i8' ),
('erectile dysfunction', '8t8t8' ),
('exercise-induced asthma', '8l8l8' ),
('female sexual dysfunction', '8k8k8' ),
('folliculitis', '8h8h8' ),
('fuchs dystrophy', '8j8j8' ),
('functional dyspepsia', '8g8g8' ),
('gender dyspohoria', '8f8f8' ),
('glioblastoma', '8d8d8' ),
('H1N1(swine flu)', '8z8z8' ),
('hair loss', '8x8x8' ),
('hashimotos disease', '8c8c8' ),
('hay fever', '8v8v8' ),
('hantavirus pulmonary syndrome', '9p9p9' ),
('heart palpitations', '9o9o9' ),
('heart murmurs', '9i9i9' ),
('hemangioma', '9u9u9' ),
('hemorrhoids', '9y9y9' ),
('lynch syndrome', '9l9l9' ),
('high blood pressure', '9k9k9' ),
('hoarding disorder', '9j9j9' ),
('hurthle cell cancer', '9h9h9' ),
('hypercalcemia', '9g9g9' ),
('hyperthyroidism', '9c9c9' ),
('indigestion', '9v9v9' ),
('klippel-trenaunay syndrome', '9b9b9' ),
('personality disorder', '9n9n9' ),
('plantar warts', '9m9m9' );
CREATE TABLE "user_conditions" (
"id" SERIAL PRIMARY KEY,
"condition_id" INT REFERENCES conditions(id),
"user_id" INT REFERENCES "user"("id"),
"verified" VARCHAR DEFAULT 'false',
"con_name" VARCHAR,
CONSTRAINT con_user_id UNIQUE("con_name", "user_id")
);
--- CONSTRAINT user_question UNIQUE (user_id, questions_id)