-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDDL.sql
More file actions
628 lines (571 loc) · 16.5 KB
/
DDL.sql
File metadata and controls
628 lines (571 loc) · 16.5 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
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
--Tabelle temporanee
create table glassdoor_country2digit
(
countrycode char(2),
countryname varchar(50)
);
create table glassdoor_currency_exchange
(
code char(3),
country varchar(100),
currency varchar(50),
number numeric,
exchange_rate numeric
);
create table glassdoor_benefits_comments
(
id varchar(10),
index integer,
city varchar(50),
comment text,
date timestamp,
jobrelated varchar(10),
jobtitle varchar(100),
benefitsrating integer,
state varchar(20)
);
create table glassdoor_benefits_highlights
(
id varchar(10),
phrase text,
icon varchar(20),
benefitname varchar(50),
index integer,
countreviews integer
);
create table glassdoor_reviews
(
id varchar(10),
index integer,
cons text,
revdate varchar(30),
featured varchar(10),
helpful integer,
revid varchar(10),
pros text,
pubdate varchar(30),
publisher varchar(100),
careerrating numeric,
companybenefits numeric,
culturerating numeric,
overallrating numeric,
seniormanagrating numeric,
worklifebalancerating numeric,
timeworked varchar(30),
currrel text,
jobtitle varchar(100),
location varchar(100),
employeetype varchar(30),
ceoapproval numeric,
unknown integer,
companyrecommend integer,
revtitle text,
advicetomangm text,
compreply text,
idresp varchar(10)
);
create table glassdoor_revresponses
(
id varchar(10),
index integer,
date timestamp,
helpful integer,
jobtitle varchar(100),
nothelpnum integer,
text text,
textlenght integer,
helpnum integer,
updatedate timestamp
);
create table glassdoor_salaries
(
id varchar(10),
index integer,
numsalaryreport integer,
jobtitle varchar(150),
payperiod varchar(20),
payperc10 numeric,
payperc90 numeric,
payperc50 numeric,
whoreported varchar(20)
);
create table glassdoor
(
benrating numeric,
bencomments varchar(10),
benhighlights varchar(10),
bennumratings numeric,
benemployersummary text,
breadcrumbs integer,
category integer,
empid varchar(10),
empname varchar(100),
empsize varchar(20),
expired varchar(10),
industry varchar(50),
industryid varchar(10),
jobid varchar(20),
jobidint varchar(20),
jobtitle varchar(200),
location varchar(100),
locationid varchar(10),
locationtype varchar(10),
guid varchar(50),
guidvalid varchar(10),
guidpart1 varchar(50),
guidpart2 varchar(50),
sector varchar(100),
sectorid varchar(10),
trackingcat varchar(20),
trackingsrc varchar(20),
trackingxsp varchar(20),
viewdisplaymillis integer,
requirestracking varchar(10),
trackingurl text,
headadorderid varchar(10),
headadvertisertype varchar(10),
headapplicationid varchar(10),
headapplybuttondisabled varchar(10),
headapplyurl text,
headblur varchar(10),
headcoverphoto text,
headeasyapply varchar(10),
heademployerid varchar(10),
heademployername varchar(200),
headexpired varchar(50),
headgocid text,
headhideceo varchar(10),
headjobtitle varchar(200),
headlocid varchar(10),
headlocation varchar(100),
headlocationtype varchar(3),
headlogo text,
headlogox2 text,
headorganic varchar(10),
headoverviewurl text,
headposted varchar(20),
headrating numeric,
headsaved varchar(10),
headsavedjobid integer,
headsgocid varchar(10),
headsponsored varchar(10),
headuseradmin varchar(10),
headuxapplytype varchar(10),
headfeaturedvideo text,
headnormalizedjob varchar(150),
headurgencylabel text,
headurgencylabelformessage text,
headurgencymessage text,
headneedscommission varchar(10),
headpayhigh numeric,
headpaylow numeric,
headpaymed numeric,
headpayperiod varchar(10),
headsalaryhigh numeric,
headsalarylow numeric,
headsalarysource varchar(30),
jobdescription text,
jobdiscoverdate timestamp,
jobeolhashcode numeric,
jobimportconfid varchar(10),
jobreqid numeric,
jobreqidint numeric,
jobsource text,
jobtitleid varchar(10),
joblistingid varchar(15),
joblistingidint varchar(15),
mapcountry varchar(30),
mapemployername varchar(100),
maplat double precision,
maplong double precision,
maplocation varchar(100),
mapaddress varchar(200),
mappostalcode varchar(100),
ovallbenefitslink text,
ovallphotoslink text,
ovallrevlink text,
ovallsalarieslink text,
ovfoundedyear integer,
ovhq varchar(100),
ovindustry varchar(50),
ovindustryid varchar(10),
ovrevenue varchar(100),
ovsector varchar(50),
ovsectorid varchar(10),
ovsize varchar(50),
ovstock varchar(50),
ovtype varchar(30),
ovdescription text,
ovmission text,
ovwebsite text,
ovallvideoslink text,
ovcompetitors varchar(10),
ovcompanyvideo text,
photos numeric,
ratceoname varchar(200),
ratceophoto text,
ratceophoto2 text,
ratceoratcount integer,
ratceoapproval numeric,
ratrecomtofriend numeric,
ratstarrating numeric,
reviews integer,
salcountry3let varchar(3),
salcountryiso varchar(2),
salcountrycontcode varchar(2),
salcountrycontname varchar(20),
salcountrycontid varchar(5),
salcountrycontnew varchar(6),
salcountryfips varchar(2),
salcountrycurrcode varchar(3),
salcountrycurrencydefdig integer,
salcountrycurrname varchar(50),
salcountrycurrid varchar(3),
salcountrycurrname2 varchar(50),
salcountrycurrnegtempl varchar(5),
salountrycurrnew varchar(6),
salcountrycurrpostempl varchar(5),
salcountrycurrsymbol varchar(10),
salcountrycurrcode2 varchar(3),
salcountrydeflocal varchar(10),
salcountrydefname varchar(20),
salcountrydefshortname varchar(20),
salcountryemplsolcount varchar(6),
salcountryid varchar(3),
salcountrylongname varchar(20),
salcountrymajor varchar(6),
salcountryname varchar(20),
salcountrynew varchar(6),
salcountrypop integer,
salcountryshortname varchar(2),
salcountrytld varchar(5),
salcountrytype varchar(2),
salcountryuniname varchar(20),
salcountrycentrname varchar(20),
salcurrcode varchar(3),
salcurrdefdig integer,
salcurrdispname varchar(30),
salcurrid varchar(3),
salcurrname varchar(30),
salcurrnegtempl varchar(5),
salcurrnew varchar(6),
salcurrpostempl varchar(5),
salcurrsymbol varchar(10),
sallassalarydate timestamp,
salsalaries integer,
wwfu varchar(10)
);
--Tabelle effettive
CREATE TABLE users
(
idUser serial
);
create table employee
(
job varchar(200),
location varchar(100),
company varchar(150)
) inherits (users);
create table currEmployee
(
relation varchar(200)
) INHERITS (employee);
create table ExEmployee
(
relation varchar(200)
) INHERITS (employee);
create table opinion
(
opinionid varchar(10)
);
create table benefitshighlights
(
opinionid varchar(10),
index integer,
highlights text,
benefitsname varchar(100),
countbenefitsreviews integer
);
create table benefitscommets
(
opinionid varchar(10),
index integer,
city varchar(100),
employeecomment text,
commentdate date,
currentjobrelated varchar(10),
employeejob varchar(100),
benefitsrating integer,
state varchar(50)
);
create table review
(
opinionid varchar(10),
reviewid varchar(10),
index integer,
reviewtitle text,
cons text,
reviewdate varchar(50),
featured varchar(10),
pros text,
publicationdate varchar(50),
careerrating numeric,
benefitsrating numeric,
culturevaluesrating numeric,
overallrating numeric,
senmanagrating numeric,
workliferating numeric,
timeworked varchar(200),
currrel varchar(200),
revjobtitle varchar(100),
revlocation varchar(100),
ceoapproval numeric,
recommendedcompany integer,
revmanadv text,
revrespid varchar(30)
);
create table revreply
(
reviewid varchar(10),
index integer,
revjobtitle varchar(100),
revtext text,
revtextlenght integer,
revupdatedate date
);
create table reply
(
replydate date,
replyid varchar(10),
replyindex integer,
reviewid varchar(10),
reviewindex integer,
reviewlisting varchar(10)
);
create table listing
(
listingid varchar(10),
OpinionId varchar(10)
);
create type job_item as
(
jobdescription text,
jobsource varchar(50),
jobtitleid varchar(10),
discoverdate date
);
create type header_item as
(
adorderid varchar(10),
advertisertype varchar(100),
empid varchar(10),
empname varchar(100),
expired varchar(50),
hideceoinfo varchar(10),
jobid varchar(10),
jobtitle varchar(200),
joblocation varchar(200),
joblocationid varchar(10),
posted varchar(50),
companyrating numeric,
sponsored varchar(10),
payment90perc integer,
payment10perc integer,
medianpayment integer,
payperiod varchar(20)
);
create type benefits_item as
(
numratings integer,
benefitssummary text,
benefitsratings numeric
);
create type salaries_item as
(
currencycode varchar(5),
lastsalarydate date,
salary varchar(10)
);
create type ratings_item as
(
ceoname varchar(200),
ceoapproval numeric,
recommendedtofriend numeric,
starrating numeric,
reviews integer,
ratingscount integer
);
create type map_item as
(
country varchar(50),
latitude float,
longitude float,
location varchar(100),
address varchar(200),
postalcode varchar(50)
);
create table section
(
listingid varchar(10),
job job_item,
header header_item,
benefits benefits_item,
salaries salaries_item,
ratings ratings_item,
map map_item
);
create table currencyexchange
(
code3digits varchar(5),
countryname varchar(100),
currencyname varchar(50),
currencynumber numeric,
exchangerate numeric
);
create table country2digit
(
countrycode varchar(5),
countryname varchar(50)
);
create type industry_sector_item as
(
id varchar(10),
denomination varchar(50)
);
create table company
(
empid varchar(10),
empname varchar(100),
companyfoundationyear integer,
companyheadquarters varchar(100),
industry industry_sector_item,
sector industry_sector_item,
companyrevenue varchar(100),
companysize varchar(40),
companydescription text,
companymission text,
companytype varchar(50)
) inherits (users);
create table salarieslist
(
listingid varchar(10),
index integer,
countsalaryrep integer,
jobtitle varchar(150),
payperiod varchar(30),
payperc10 numeric,
payperc90 numeric,
payperc50 numeric,
whoreport varchar(50)
);
--Tabelle di supporto per le query
--Aree e Nazioni che le compongono
CREATE TABLE mapAreas
(
Area varchar(30),
Countries varchar(500)
);
--Salvataggio dei dati json risultanti dalla pipeline NER
CREATE TABLE highlightsResults
(
id serial,
comment json
);
--Tabella che funge da template per la trasformazione da json
create table Features
(
indices text,
source text,
string text,
length int,
category text,
chunk text
);
--Salvataggio dei dati CSV risultati dalla pipeline di PMI
CREATE TABLE mixedBag
(
term text,
lang text,
type text,
term2 text,
lang2 text,
type2 text,
pmiscore decimal,
docFreq int,
freq int
);
--Salvataggio dei dati CSV risultanti dalla pipeline di Corpus Analysis
CREATE TABLE TfIdftable
(
term text,
typology varchar(20),
lang varchar(10),
tfidf decimal,
tfidfraw decimal,
tf decimal,
locdocfr decimal,
refdocfr decimal
);
CREATE TABLE Annotationtable
(
term text,
typology varchar(20),
lang varchar(10),
tfidfaug decimal,
tfidfaugra decimal,
tf decimal,
locdocfr decimal
);
CREATE TABLE Hyponymytable
(
term text,
typology varchar(20),
lang varchar(10),
kdomRel decimal,
kdomRelra decimal,
tf decimal,
hypCount decimal,
locdocfr decimal
);
--Tipi composti per la creazione della tabella dove salvare i risultati della pipelina di Corpus Analysis
CREATE TYPE TfIdf as
(
term text,
typology varchar(20),
lang varchar(10),
tfidf decimal,
tfidfraw decimal,
tf decimal,
locdocfr decimal,
refdocfr decimal
);
CREATE TYPE Annotation as
(
term text,
typology varchar(20),
lang varchar(10),
tfidfaug decimal,
tfidfaugra decimal,
tf decimal,
locdocfr decimal
);
CREATE TYPE Hyponymy AS
(
term text,
typology varchar(20),
lang varchar(10),
kdomRel decimal,
kdomRelra decimal,
tf decimal,
hypCount decimal,
locdocfr decimal
);
--Tabella per contenere i risultati della pipeline di Corpus Analysis
CREATE TABLE CorpusStats(
tfidf TfIdf,
annotation Annotation,
hyponymy Hyponymy
);
CREATE TABLE JobDescription() INHERITS (CorpusStats);
CREATE TABLE Pros() INHERITS (CorpusStats);
CREATE TABLE Cons() INHERITS (CorpusStats);