-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.yml
557 lines (536 loc) · 23 KB
/
schema.yml
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
version: 2
models:
- name: 202242_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 42](https://preppindata.blogspot.com/2022/10/2022-week-42-missing-training-data.html).
Created as view and exported as [202242_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202242_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: player
type: VARCHAR
- name: session
type: VARCHAR
- name: session_date
type: DATE
- name: score
type: BIGINT
tests:
- not_null
- name: flag
type: VARCHAR
tests:
- accepted_values:
values: [Actual, Carried Over]
- name: 202239_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 39](https://preppindata.blogspot.com/2022/09/2022-week-39-filling-in-for-hr.html).
Created as view and exported as [202239_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202239_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: record_id
type: BIGINT
tests:
- unique
- not_null
- name: employee
type: VARCHAR
tests:
- not_null
- name: work_level
type: VARCHAR
tests:
- not_null
- name: stage
type: VARCHAR
- name: date
type: DATE
- name: 202243_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 43](https://preppindata.blogspot.com/2022/10/2022-week-43-missing-training-data-20.html).
Created as view and exported as [202243_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202243_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: player
type: VARCHAR
- name: session
type: VARCHAR
- name: session_date
type: DATE
- name: score
type: BIGINT
tests:
- not_null
- name: flag
type: VARCHAR
tests:
- accepted_values:
values: [Actual, Carried Over, Pre First Session]
- name: 202201_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 1](https://preppindata.blogspot.com/2022/01/2022-week-1-prep-school-parental.html).
Created as view and exported as [202201_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202201_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: academic_year
type: INTEGER
- name: pupils_name
type: VARCHAR
- name: parental_contact_full_name
type: VARCHAR
- name: parental_contact_email_address
type: VARCHAR
- name: 202244_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 44](https://preppindata.blogspot.com/2022/11/2022-week-44-creating-order-ids.html).
Created as view and exported as [202244_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202244_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: order_id
type: VARCHAR
tests:
- not_null
- unique
- name: order_number
type: BIGINT
tests:
- not_null
- name: customer
type: VARCHAR
tests:
- not_null
- name: order_date
type: DATE
tests:
- not_null
- name: 202245_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 45](https://preppindata.blogspot.com/2022/11/2022-week-45-strange-table-structure.html).
Created as view and exported as [202245_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202245_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: store
type: VARCHAR
tests:
- not_null
- accepted_values:
values: [Dulwich, Wimbledon, Notting Hill, Lewisham]
- name: date
type: DATE
tests:
- not_null
- name: sales
type: BIGINT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 0'
- name: profit
type: BIGINT
tests:
- not_null
- name: 202247_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 47](https://preppindata.blogspot.com/2022/11/2022-week-47-chelsea-managers-per-prime.html).
Created as view and exported as [202247_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202247_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: prime_minister
type: VARCHAR
tests:
- not_null
- name: term_begin
type: DATE
tests:
- not_null
- name: term_end
type: DATE
- name: managers
type: HUGEINT
- name: matches
type: HUGEINT
- name: matches_won
type: HUGEINT
- name: matches_drawn
type: HUGEINT
- name: matches_lost
type: HUGEINT
- name: win_percent
type: DECIMAL(8,2)
- name: 202248_solution_1
description: >
Solution SQL definition #1 for [Preppin' Data 2022 Week 48](https://preppindata.blogspot.com/2022/11/2022-week-48-tiddlywinks-tidy.html).
Created as view and exported as [202248_solution_1_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202248_solution_1_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: event_id
type: INT
tests:
- not_null
- name: competitor
type: VARCHAR
tests:
- not_null
- name: game_order
type: VARCHAR
- name: score
type: NUMERIC(8,6)
- name: potout
type: BOOLEAN
- name: note
type: VARCHAR
- name: 202248_solution_2
description: >
Solution SQL definition #2 for [Preppin' Data 2022 Week 48](https://preppindata.blogspot.com/2022/11/2022-week-48-tiddlywinks-tidy.html).
Created as view and exported as [202248_solution_2_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202248_solution_2_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: event_id
type: INT
tests:
- not_null
- name: competitor
type: VARCHAR
tests:
- not_null
- name: event
type: VARCHAR
- name: event_start_date
type: DATE
- name: event_description
type: VARCHAR
- name: association
type: VARCHAR
- name: points
type: NUMERIC(8,6)
- name: wins
type: INT
- name: losses
type: INT
- name: ties
type: INT
- name: 202249_solution_1
description: >
Solution SQL definition #1 for [Preppin' Data 2022 Week 49](https://preppindata.blogspot.com/2022/12/2022-week-49-cleaning-status-history-hr.html).
Created as view and exported as [202249_solution_1_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202249_solution_1_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: candidate_id
type: INT
tests:
- not_null
- name: position_id
type: INT
tests:
- not_null
- name: status
type: VARCHAR
tests:
- not_null
- name: ts
type: DATETIME
- name: filename
type: VARCHAR
- name: 202249_solution_2
description: >
Solution SQL definition #2 for [Preppin' Data 2022 Week 49](https://preppindata.blogspot.com/2022/12/2022-week-49-cleaning-status-history-hr.html).
Created as view and exported as [202249_solution_2_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202249_solution_2_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: candidate_id
type: INT
tests:
- not_null
- name: position_id
type: INT
tests:
- not_null
- name: current_status
type: VARCHAR
tests:
- not_null
- name: 202250_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 50](https://preppindata.blogspot.com/2022/12/2022-week-50-withdrawals-hr-month.html).
Created as view and exported as [202250_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202250_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: status_before_withdrawal
type: VARCHAR
tests:
- not_null
- unique
- name: withdrawals
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- name: total_in_status
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 0'
- name: pct_withdrawn
type: NUMERIC(8,1)
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- dbt_utils.expression_is_true:
expression: '<= 100'
- name: 202251_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 51](https://preppindata.blogspot.com/2022/12/2022-week-51-parsing-unfortunate-report.html).
Created as view and exported as [202251_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202251_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: application_month
type: DATE
tests:
- not_null
- unique
- name: total_candidates
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- name: candidates_with_preferred_qualifications
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- name: percent_preferred_of_total_candidates
type: NUMERIC(8,1)
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- dbt_utils.expression_is_true:
expression: '<= 100'
- name: 202252_solution
description: >
Solution SQL definition for [Preppin' Data 2022 Week 52](https://preppindata.blogspot.com/2022/12/2022-week-52-find-sub-departments-from.html).
Created as view and exported as [202252_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202252_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: position_id
type: VARCHAR
tests:
- not_null
- unique
- name: employee_id
type: VARCHAR
tests:
- not_null
- unique
- name: title
type: VARCHAR
tests:
- not_null
- name: department
type: VARCHAR
tests:
- not_null
- name: supervisor_id
type: VARCHAR
- name: team_id
type: VARCHAR
- name: direct_reports
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 0'
- name: team_name
type: VARCHAR
- name: team_hierarchy
type: VARCHAR
- name: employee_id_hierarchy
type: VARCHAR
- name: dependent_team_ids
type: VARCHAR
- name: hierarchy_level
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 1'
- name: subdept_team_id
type: VARCHAR
- name: subdept_name
type: VARCHAR
- name: 202301_solution_1
description: >
Solution SQL definition #1 for [Preppin' Data 2023 Week 1](https://preppindata.blogspot.com/2023/01/2023-week-1-data-source-bank.html).
Created as view and exported as [202301_solution_1_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202301_solution_1_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: bank
type: VARCHAR
tests:
- not_null
- unique
- name: value
type: BIGINT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 1'
- name: 202301_solution_2
description: >
Solution SQL definition #2 for [Preppin' Data 2023 Week 1](https://preppindata.blogspot.com/2023/01/2023-week-1-data-source-bank.html).
Created as view and exported as [202301_solution_2_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202301_solution_2_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: bank
type: VARCHAR
tests:
- not_null
- name: online_or_in_person
type: VARCHAR
tests:
- not_null
- name: transaction_date
type: VARCHAR
tests:
- not_null
- name: value
type: BIGINT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 1'
- name: 202301_solution_3
description: >
Solution SQL definition #3 for [Preppin' Data 2023 Week 1](https://preppindata.blogspot.com/2023/01/2023-week-1-data-source-bank.html).
Created as view and exported as [202301_solution_3_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202301_solution_3_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: bank
type: VARCHAR
tests:
- not_null
- name: customer_code
type: VARCHAR
tests:
- not_null
- name: value
type: BIGINT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 0'
- name: 202302_solution
description: >
Solution SQL definition for [Preppin' Data 2023 Week 2](https://preppindata.blogspot.com/2023/01/2023-week-2-international-bank-account.html).
Created as view and exported as [202302_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202302_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: transaction_id
type: BIGINT
tests:
- unique
- not_null
- name: iban
type: VARCHAR
tests:
- not_null
- name: 202303_solution
description: >
Solution SQL definition for [Preppin' Data 2023 Week 3](https://preppindata.blogspot.com/2023/01/2023-week-3-targets-for-dsb.html).
Created as view and exported as [202303_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202303_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: online_or_in_person
type: VARCHAR
tests:
- not_null
- name: quarter
type: INT
tests:
- not_null
- name: value
type: BIGINT
- name: quarterly_targets
type: BIGINT
- name: variance_to_target
type: BIGINT
- name: 202304_solution
description: >
Solution SQL definition for [Preppin' Data 2023 Week 4](https://preppindata.blogspot.com/2023/01/2023-week-4-new-customers.html).
Created as view and exported as [202304_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202304_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: id
type: BIGINT
tests:
- not_null
- name: joining_date
type: DATE
tests:
- not_null
- name: account_type
type: VARCHAR
tests:
- not_null
- accepted_values:
values: [Basic, Gold, Platinum]
- name: date_of_birth
type: DATE
tests:
- not_null
- name: ethnicity
type: VARCHAR
tests:
- not_null
- accepted_values:
values: [Asian, Black, White, Other]
- name: 202305_solution
description: >
Solution SQL definition for [Preppin' Data 2023 Week 5](https://preppindata.blogspot.com/2023/02/2023-week-5-dsb-ranking.html).
Created as view and exported as [202305_solution_output.csv](https://github.com/jharris126/preppin-data-dbt/blob/master/solution_outputs/202305_solution_output.csv) in [/preppin-data-dbt/solution_outputs](https://github.com/jharris126/preppin-data-dbt/tree/master/solution_outputs) folder.
All solutions sql files automatically generate a `.csv` output file when run using the [model_to_csv macro](#!/macro/macro.preppin_data.model_to_csv).
columns:
- name: transaction_date
type: VARCHAR
tests:
- not_null
- accepted_values:
values: [January, February, March, April, May, June, July, August, September, October, November, December]
- name: bank
type: VARCHAR
tests:
- not_null
- accepted_values:
values: [DS, DTB, DSB]
- name: value
type: BIGINT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 0'
- name: bank_rank_per_month
type: INT
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '>= 1'
- dbt_utils.expression_is_true:
expression: '<= 3'
- name: avg_transaction_value_per_rank
type: NUMERIC
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 0'
- name: avg_rank_per_bank
type: NUMERIC
tests:
- not_null
- dbt_utils.expression_is_true:
expression: '> 1'
- dbt_utils.expression_is_true:
expression: '< 3'