-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_table.sql
More file actions
830 lines (754 loc) · 33.4 KB
/
Copy pathcreate_table.sql
File metadata and controls
830 lines (754 loc) · 33.4 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
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
-- This script was generated by the ERD tool in pgAdmin 4.
-- Please log an issue at https://github.com/pgadmin-org/pgadmin4/issues/new/choose if you find any bugs, including reproduction steps.
BEGIN;
CREATE TABLE IF NOT EXISTS public.alembic_version
(
version_num character varying(32) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
CREATE TABLE IF NOT EXISTS public.altia_elpac_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"OverallMeanScaleScore" numeric(6, 1),
"OverallPerfLvl1Pcnt" numeric(5, 2),
"OverallPerfLvl1Count" integer,
"OverallPerfLvl2Pcnt" numeric(5, 2),
"OverallPerfLvl2Count" integer,
"OverallPerfLvl3Pcnt" numeric(5, 2),
"OverallPerfLvl3Count" integer,
"OverallPerfLvl4Pcnt" numeric(5, 2),
"OverallPerfLvl4Count" integer,
"OralLangMeanScaleScore" numeric(6, 1),
"OralLangPerfLvl1Pcnt" numeric(5, 2),
"OralLangPerfLvl1Count" integer,
"OralLangPerfLvl2Pcnt" numeric(5, 2),
"OralLangPerfLvl2Count" integer,
"OralLangPerfLvl3Pcnt" numeric(5, 2),
"OralLangPerfLvl3Count" integer,
"OralLangPerfLvl4Pcnt" numeric(5, 2),
"OralLangPerfLvl4Count" integer,
"OralLangTotal" integer,
"WritLangMeanScaleScore" numeric(6, 1),
"WritLangPerfLvl1Pcnt" numeric(5, 2),
"WritLangPerfLvl1Count" integer,
"WritLangPerfLvl2Pcnt" numeric(5, 2),
"WritLangPerfLvl2Count" integer,
"WritLangPerfLvl3Pcnt" numeric(5, 2),
"WritLangPerfLvl3Count" integer,
"WritLangPerfLvl4Pcnt" numeric(5, 2),
"WritLangPerfLvl4Count" integer,
"WritLangTotal" integer,
CONSTRAINT altia_elpac_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_altia_elpac_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.altsa_elpac_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"OverallMeanScaleScore" numeric(6, 1),
"OverallPerfLvl1Pcnt" numeric(5, 2),
"OverallPerfLvl1Count" integer,
"OverallPerfLvl2Pcnt" numeric(5, 2),
"OverallPerfLvl2Count" integer,
"OverallPerfLvl3Pcnt" numeric(5, 2),
"OverallPerfLvl3Count" integer,
CONSTRAINT altsa_elpac_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_altsa_elpac_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.caa_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
test_type character varying(1) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"Mean Scale Score" numeric(6, 1),
"Count Level 1" integer,
"Count Level 2" integer,
"Count Level 3" integer,
"Percentage Level 1" numeric(5, 2),
"Percentage Level 2" numeric(5, 2),
"Percentage Level 3" numeric(5, 2),
CONSTRAINT caa_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_caa_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.caas_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
test_type character varying(1) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"Mean Scale Score" numeric(6, 1),
"Count Level 1" integer,
"Count Level 2" integer,
"Count Level 3" integer,
"Percentage Level 1" numeric(5, 2),
"Percentage Level 2" numeric(5, 2),
"Percentage Level 3" numeric(5, 2),
CONSTRAINT caas_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_caas_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.caaspp_student_groups
(
demographic_id character varying(10) COLLATE pg_catalog."default" NOT NULL,
demographic_id_num integer,
demographic_name character varying(255) COLLATE pg_catalog."default",
student_group character varying(255) COLLATE pg_catalog."default",
CONSTRAINT caaspp_student_groups_pkey PRIMARY KEY (demographic_id)
);
CREATE TABLE IF NOT EXISTS public.caaspp_tests
(
test_id serial NOT NULL,
test_id_num integer,
test_name character varying(255) COLLATE pg_catalog."default",
CONSTRAINT caaspp_tests_pkey PRIMARY KEY (test_id)
);
CREATE TABLE IF NOT EXISTS public.cast_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
test_type character varying(1) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"Mean Scale Score" numeric(6, 1),
"Count Standard Exceeded" integer,
"Count Standard Met" integer,
"Count Standard Met and Above" integer,
"Count Standard Nearly Met" integer,
"Count Standard Not Met" integer,
"Percentage Standard Exceeded" numeric(5, 2),
"Percentage Standard Met" numeric(5, 2),
"Percentage Standard Met and Above" numeric(5, 2),
"Percentage Standard Nearly Met" numeric(5, 2),
"Percentage Standard Not Met" numeric(5, 2),
"Earth and Space Sciences Domain Count Above Standard" integer,
"Earth and Space Sciences Domain Count Below Standard" integer,
"Earth and Space Sciences Domain Count Near Standard" integer,
"Earth and Space Sciences Domain Percent Above Standard" numeric(5, 2),
"Earth and Space Sciences Domain Percent Below Standard" numeric(5, 2),
"Earth and Space Sciences Domain Percent Near Standard" numeric(5, 2),
"Earth and Space Sciences Domain Total" integer,
"Life Sciences Domain Count Above Standard" integer,
"Life Sciences Domain Count Below Standard" integer,
"Life Sciences Domain Count Near Standard" integer,
"Life Sciences Domain Percent Above Standard" numeric(5, 2),
"Life Sciences Domain Percent Below Standard" numeric(5, 2),
"Life Sciences Domain Percent Near Standard" numeric(5, 2),
"Life Sciences Domain Total" integer,
"Physical Sciences Domain Count Above Standard" integer,
"Physical Sciences Domain Count Below Standard" integer,
"Physical Sciences Domain Count Near Standard" integer,
"Physical Sciences Domain Percent Above Standard" numeric(5, 2),
"Physical Sciences Domain Percent Below Standard" numeric(5, 2),
"Physical Sciences Domain Percent Near Standard" numeric(5, 2),
"Physical Sciences Domain Total" integer,
CONSTRAINT cast_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_cast_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.census_data
(
academic_year integer NOT NULL,
aggregation_level character varying COLLATE pg_catalog."default" NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default" NOT NULL,
charter character varying(255) COLLATE pg_catalog."default",
reporting_category character varying(255) COLLATE pg_catalog."default" NOT NULL,
total_enr integer NOT NULL,
gr_tk integer NOT NULL,
gr_kn integer NOT NULL,
gr_1 integer NOT NULL,
gr_2 integer NOT NULL,
gr_3 integer NOT NULL,
gr_4 integer NOT NULL,
gr_5 integer NOT NULL,
gr_6 integer NOT NULL,
gr_7 integer NOT NULL,
gr_8 integer NOT NULL,
gr_9 integer NOT NULL,
gr_10 integer NOT NULL,
gr_11 integer NOT NULL,
gr_12 integer NOT NULL,
id uuid NOT NULL,
CONSTRAINT census_data_pkey PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.csa_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
test_type character varying(1) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"Overall Mean Scale Score" numeric(6, 1),
"Count Level 1" integer,
"Count Level 2" integer,
"Count Level 3" integer,
"Percent Level 1" numeric(5, 2),
"Percent Level 2" numeric(5, 2),
"Percent Level 3" numeric(5, 2),
"Composite 1 Count Level 1" integer,
"Composite 1 Count Level 2" integer,
"Composite 1 Count Level 3" integer,
"Composite 1 Mean Scale Score" numeric(6, 1),
"Composite 1 Percent Level 1" numeric(5, 2),
"Composite 1 Percent Level 2" numeric(5, 2),
"Composite 1 Percent Level 3" numeric(5, 2),
"Composite 1 Total" integer,
"Composite 2 Count Level 1" integer,
"Composite 2 Count Level 2" integer,
"Composite 2 Count Level 3" integer,
"Composite 2 Mean Scale Score" numeric(6, 1),
"Composite 2 Percent Level 1" numeric(5, 2),
"Composite 2 Percent Level 2" numeric(5, 2),
"Composite 2 Percent Level 3" numeric(5, 2),
"Composite 2 Total" integer,
"Listening Domain Count Level 1" integer,
"Listening Domain Count Level 2" integer,
"Listening Domain Count Level 3" integer,
"Listening Domain Percent Level 1" numeric(5, 2),
"Listening Domain Percent Level 2" numeric(5, 2),
"Listening Domain Percent Level 3" numeric(5, 2),
"Listening Domain Total" integer,
"Reading Domain Count Level 1" integer,
"Reading Domain Count Level 2" integer,
"Reading Domain Count Level 3" integer,
"Reading Domain Percent Level 1" numeric(5, 2),
"Reading Domain Percent Level 2" numeric(5, 2),
"Reading Domain Percent Level 3" numeric(5, 2),
"Reading Domain Total" integer,
"Speaking Domain Count Level 1" integer,
"Speaking Domain Count Level 2" integer,
"Speaking Domain Count Level 3" integer,
"Speaking Domain Percent Level 1" numeric(5, 2),
"Speaking Domain Percent Level 2" numeric(5, 2),
"Speaking Domain Percent Level 3" numeric(5, 2),
"Speaking Domain Total" integer,
"Writing Domain Count Level 1" integer,
"Writing Domain Count Level 2" integer,
"Writing Domain Count Level 3" integer,
"Writing Domain Percent Level 1" numeric(5, 2),
"Writing Domain Percent Level 2" numeric(5, 2),
"Writing Domain Percent Level 3" numeric(5, 2),
"Writing Domain Total" integer,
CONSTRAINT csa_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_csa_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.elpac_student_groups
(
student_group_id character varying(10) COLLATE pg_catalog."default" NOT NULL,
student_group_name character varying(255) COLLATE pg_catalog."default",
CONSTRAINT elpac_student_groups_pkey PRIMARY KEY (student_group_id)
);
CREATE TABLE IF NOT EXISTS public.elpac_tests
(
test_id serial NOT NULL,
test_name character varying(255) COLLATE pg_catalog."default",
CONSTRAINT elpac_tests_pkey PRIMARY KEY (test_id)
);
CREATE TABLE IF NOT EXISTS public.entities
(
cds_code character varying(14) COLLATE pg_catalog."default" NOT NULL,
county_name character varying(25) COLLATE pg_catalog."default",
district_name character varying(40) COLLATE pg_catalog."default",
school_name character varying(60) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
zip_code character varying(9) COLLATE pg_catalog."default",
type_id integer,
CONSTRAINT entities_pkey PRIMARY KEY (cds_code)
);
CREATE TABLE IF NOT EXISTS public.ia_elpac_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"OverallMeanSclScr" numeric(6, 1),
"NoviceELPerfLvlPcnt" numeric(5, 2),
"NoviceELPerfLvlCount" integer,
"IntermediateELPerfLvlPcnt" numeric(5, 2),
"IntermediateELPerfLvlCount" integer,
"IFEPPerfLvlPcnt" numeric(5, 2),
"IFEPPerfLvlCount" integer,
"OralLangMinimallyDevelopedPerfLvlPcnt" numeric(5, 2),
"OralLangMinimallyDevelopedPerfLvlCount" integer,
"OralLangModeratelyDevelopedPerfLvlPcnt" numeric(5, 2),
"OralLangModeratelyDevelopedPerfLvlCount" integer,
"OralLangWellDevelopedPerfLvlPcnt" numeric(5, 2),
"OralLangWellDevelopedPerfLvlCount" integer,
"OralLangTotal" integer,
"WritLangMinimallyDevelopedPerfLvlPcnt" numeric(5, 2),
"WritLangMinimallyDevelopedPerfLvlCount" integer,
"WritLangModeratelyDevelopedPerfLvlPcnt" numeric(5, 2),
"WritLangModeratelyDevelopedPerfLvlCount" integer,
"WritLangWellDevelopedPerfLvlPcnt" numeric(5, 2),
"WritLangWellDevelopedPerfLvlCount" integer,
"WritLangTotal" integer,
listening_domain_begin_pcnt numeric(5, 2),
listening_domain_begin_count integer,
listening_domain_moderate_pcnt numeric(5, 2),
listening_domain_moderate_count integer,
listening_domain_developed_pcnt numeric(5, 2),
listening_domain_developed_count integer,
listening_domain_total integer,
speaking_domain_begin_pcnt numeric(5, 2),
speaking_domain_begin_count integer,
speaking_domain_moderate_pcnt numeric(5, 2),
speaking_domain_moderate_count integer,
speaking_domain_developed_pcnt numeric(5, 2),
speaking_domain_developed_count integer,
speaking_domain_total integer,
reading_domain_begin_pcnt numeric(5, 2),
reading_domain_begin_count integer,
reading_domain_moderate_pcnt numeric(5, 2),
reading_domain_moderate_count integer,
reading_domain_developed_pcnt numeric(5, 2),
reading_domain_developed_count integer,
reading_domain_total integer,
writing_domain_begin_pcnt numeric(5, 2),
writing_domain_begin_count integer,
writing_domain_moderate_pcnt numeric(5, 2),
writing_domain_moderate_count integer,
writing_domain_developed_pcnt numeric(5, 2),
writing_domain_developed_count integer,
writing_domain_total integer,
CONSTRAINT ia_elpac_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_ia_elpac_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.items
(
title character varying(255) COLLATE pg_catalog."default" NOT NULL,
description character varying(255) COLLATE pg_catalog."default",
id uuid NOT NULL,
created_at timestamp without time zone,
owner_id uuid NOT NULL,
CONSTRAINT items_pkey PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.sa_elpac_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"OverallMeanScaleScore" numeric(6, 1),
"OverallPerfLvl1Pcnt" numeric(5, 2),
"OverallPerfLvl1Count" integer,
"OverallPerfLvl2Pcnt" numeric(5, 2),
"OverallPerfLvl2Count" integer,
"OverallPerfLvl3Pcnt" numeric(5, 2),
"OverallPerfLvl3Count" integer,
"OverallPerfLvl4Pcnt" numeric(5, 2),
"OverallPerfLvl4Count" integer,
"OralLangMeanScaleScore" numeric(6, 1),
"OralLangPerfLvl1Count" integer,
"OralLangPerfLvl1Pcnt" numeric(5, 2),
"OralLangPerfLvl2Count" integer,
"OralLangPerfLvl2Pcnt" numeric(5, 2),
"OralLangPerfLvl3Count" integer,
"OralLangPerfLvl3Pcnt" numeric(5, 2),
"OralLangPerfLvl4Count" integer,
"OralLangPerfLvl4Pcnt" numeric(5, 2),
"OralLangTotal" integer,
"WritLangMeanScaleScore" numeric(6, 1),
"WritLangPerfLvl1Count" integer,
"WritLangPerfLvl1Pcnt" numeric(5, 2),
"WritLangPerfLvl2Count" integer,
"WritLangPerfLvl2Pcnt" numeric(5, 2),
"WritLangPerfLvl3Count" integer,
"WritLangPerfLvl3Pcnt" numeric(5, 2),
"WritLangPerfLvl4Count" integer,
"WritLangPerfLvl4Pcnt" numeric(5, 2),
"WritLangTotal" integer,
listening_domain_begin_pcnt numeric(5, 2),
listening_domain_begin_count integer,
listening_domain_moderate_pcnt numeric(5, 2),
listening_domain_moderate_count integer,
listening_domain_developed_pcnt numeric(5, 2),
listening_domain_developed_count integer,
listening_domain_total integer,
speaking_domain_begin_pcnt numeric(5, 2),
speaking_domain_begin_count integer,
speaking_domain_moderate_pcnt numeric(5, 2),
speaking_domain_moderate_count integer,
speaking_domain_developed_pcnt numeric(5, 2),
speaking_domain_developed_count integer,
speaking_domain_total integer,
reading_domain_begin_pcnt numeric(5, 2),
reading_domain_begin_count integer,
reading_domain_moderate_pcnt numeric(5, 2),
reading_domain_moderate_count integer,
reading_domain_developed_pcnt numeric(5, 2),
reading_domain_developed_count integer,
reading_domain_total integer,
writing_domain_begin_pcnt numeric(5, 2),
writing_domain_begin_count integer,
writing_domain_moderate_pcnt numeric(5, 2),
writing_domain_moderate_count integer,
writing_domain_developed_pcnt numeric(5, 2),
writing_domain_developed_count integer,
writing_domain_total integer,
CONSTRAINT sa_elpac_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_sa_elpac_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.sb_results
(
id uuid NOT NULL,
cds_code character varying(14) COLLATE pg_catalog."default",
test_year integer,
student_group_id character varying COLLATE pg_catalog."default",
test_id integer,
grade character varying(2) COLLATE pg_catalog."default",
filler character varying(4) COLLATE pg_catalog."default",
test_type character varying(1) COLLATE pg_catalog."default",
type_id integer,
total_students_enrolled integer,
total_students_tested integer,
total_students_tested_with_scores integer,
overall_total integer,
"Mean Scale Score" numeric(6, 1),
"Count Standard Exceeded" integer,
"Count Standard Met" integer,
"Count Standard Met and Above" integer,
"Count Standard Nearly Met" integer,
"Count Standard Not Met" integer,
"Percentage Standard Exceeded" numeric(5, 2),
"Percentage Standard Met" numeric(5, 2),
"Percentage Standard Met and Above" numeric(5, 2),
"Percentage Standard Nearly Met" numeric(5, 2),
"Percentage Standard Not Met" numeric(5, 2),
"Area 1 Count Above Standard" integer,
"Area 1 Count Below Standard" integer,
"Area 1 Count Near Standard" integer,
"Area 1 Percentage Above Standard" numeric(5, 2),
"Area 1 Percentage Below Standard" numeric(5, 2),
"Area 1 Percentage Near Standard" numeric(5, 2),
"Area 1 Total" integer,
"Area 2 Count Above Standard" integer,
"Area 2 Count Below Standard" integer,
"Area 2 Count Near Standard" integer,
"Area 2 Percentage Above Standard" numeric(5, 2),
"Area 2 Percentage Below Standard" numeric(5, 2),
"Area 2 Percentage Near Standard" numeric(5, 2),
"Area 2 Total" integer,
"Area 3 Count Above Standard" integer,
"Area 3 Count Below Standard" integer,
"Area 3 Count Near Standard" integer,
"Area 3 Percentage Above Standard" numeric(5, 2),
"Area 3 Percentage Below Standard" numeric(5, 2),
"Area 3 Percentage Near Standard" numeric(5, 2),
"Area 3 Total" integer,
"Area 4 Count Above Standard" integer,
"Area 4 Count Below Standard" integer,
"Area 4 Count Near Standard" integer,
"Area 4 Percentage Above Standard" numeric(5, 2),
"Area 4 Percentage Below Standard" numeric(5, 2),
"Area 4 Percentage Near Standard" numeric(5, 2),
"Area 4 Total" integer,
"Composite Area 1 Count Above Standard" integer,
"Composite Area 1 Count Below Standard" integer,
"Composite Area 1 Count Near Standard" integer,
"Composite Area 1 Percentage Above Standard" numeric(5, 2),
"Composite Area 1 Percentage Below Standard" numeric(5, 2),
"Composite Area 1 Percentage Near Standard" numeric(5, 2),
"Composite Area 1 Total" integer,
"Composite Area 2 Count Above Standard" integer,
"Composite Area 2 Count Below Standard" integer,
"Composite Area 2 Count Near Standard" integer,
"Composite Area 2 Percentage Above Standard" numeric(5, 2),
"Composite Area 2 Percentage Below Standard" numeric(5, 2),
"Composite Area 2 Percentage Near Standard" numeric(5, 2),
"Composite Area 2 Total" integer,
CONSTRAINT sb_results_pkey PRIMARY KEY (id),
CONSTRAINT ix_sb_results_natural_key UNIQUE (cds_code, test_year, student_group_id, test_id, grade)
);
CREATE TABLE IF NOT EXISTS public.schools
(
cds_code character varying(255) COLLATE pg_catalog."default" NOT NULL,
nces_dist character varying(255) COLLATE pg_catalog."default" NOT NULL,
nces_school character varying(255) COLLATE pg_catalog."default" NOT NULL,
school_code character varying(255) COLLATE pg_catalog."default" NOT NULL,
status_type character varying(255) COLLATE pg_catalog."default",
county character varying(255) COLLATE pg_catalog."default",
district character varying(255) COLLATE pg_catalog."default",
school character varying(255) COLLATE pg_catalog."default",
street character varying COLLATE pg_catalog."default",
street_abr character varying COLLATE pg_catalog."default",
city character varying(255) COLLATE pg_catalog."default",
zip character varying(255) COLLATE pg_catalog."default",
state character varying(255) COLLATE pg_catalog."default",
mail_street character varying COLLATE pg_catalog."default",
mail_street_abr character varying COLLATE pg_catalog."default",
mail_city character varying(255) COLLATE pg_catalog."default",
mail_zip character varying(255) COLLATE pg_catalog."default",
mail_state character varying(255) COLLATE pg_catalog."default",
phone character varying(255) COLLATE pg_catalog."default",
ext character varying(255) COLLATE pg_catalog."default",
fax_number character varying(255) COLLATE pg_catalog."default",
website character varying(255) COLLATE pg_catalog."default",
open_date character varying(255) COLLATE pg_catalog."default",
closed_date character varying(255) COLLATE pg_catalog."default",
charter character varying(255) COLLATE pg_catalog."default",
charter_num character varying(255) COLLATE pg_catalog."default",
funding_type character varying(255) COLLATE pg_catalog."default",
doc character varying(255) COLLATE pg_catalog."default",
doc_type character varying(255) COLLATE pg_catalog."default",
soc character varying(255) COLLATE pg_catalog."default",
soc_type character varying(255) COLLATE pg_catalog."default",
edops_code character varying(255) COLLATE pg_catalog."default",
edops_name character varying(255) COLLATE pg_catalog."default",
eil_code character varying(255) COLLATE pg_catalog."default",
eil_name character varying(255) COLLATE pg_catalog."default",
gs_offered character varying(255) COLLATE pg_catalog."default",
gs_served character varying(255) COLLATE pg_catalog."default",
virtual character varying(255) COLLATE pg_catalog."default",
magnet character varying(255) COLLATE pg_catalog."default",
year_round_yn character varying(255) COLLATE pg_catalog."default",
federal_dfc_district_id character varying(255) COLLATE pg_catalog."default",
latitude double precision,
longitude double precision,
adm_fname character varying(255) COLLATE pg_catalog."default",
adm_lname character varying(255) COLLATE pg_catalog."default",
last_up_date character varying(255) COLLATE pg_catalog."default",
multilingual character varying(255) COLLATE pg_catalog."default",
id uuid NOT NULL,
CONSTRAINT schools_pkey PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.users
(
email character varying(255) COLLATE pg_catalog."default" NOT NULL,
is_active boolean NOT NULL,
is_superuser boolean NOT NULL,
full_name character varying(255) COLLATE pg_catalog."default",
id uuid NOT NULL,
hashed_password character varying COLLATE pg_catalog."default" NOT NULL,
created_at timestamp without time zone,
last_viewed_cds character varying(14) COLLATE pg_catalog."default",
force_password_reset boolean NOT NULL,
CONSTRAINT users_pkey PRIMARY KEY (id)
);
ALTER TABLE IF EXISTS public.altia_elpac_results
ADD CONSTRAINT altia_elpac_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.altia_elpac_results
ADD CONSTRAINT altia_elpac_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.elpac_student_groups (student_group_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_altia_elpac_results_student_group
ON public.altia_elpac_results(student_group_id);
ALTER TABLE IF EXISTS public.altia_elpac_results
ADD CONSTRAINT altia_elpac_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.elpac_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.altsa_elpac_results
ADD CONSTRAINT altsa_elpac_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.altsa_elpac_results
ADD CONSTRAINT altsa_elpac_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.elpac_student_groups (student_group_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_altsa_elpac_results_student_group
ON public.altsa_elpac_results(student_group_id);
ALTER TABLE IF EXISTS public.altsa_elpac_results
ADD CONSTRAINT altsa_elpac_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.elpac_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.caa_results
ADD CONSTRAINT caa_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.caa_results
ADD CONSTRAINT caa_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.caaspp_student_groups (demographic_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_caa_results_student_group
ON public.caa_results(student_group_id);
ALTER TABLE IF EXISTS public.caa_results
ADD CONSTRAINT caa_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.caaspp_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.caas_results
ADD CONSTRAINT caas_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.caas_results
ADD CONSTRAINT caas_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.caaspp_student_groups (demographic_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_caas_results_student_group
ON public.caas_results(student_group_id);
ALTER TABLE IF EXISTS public.caas_results
ADD CONSTRAINT caas_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.caaspp_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.cast_results
ADD CONSTRAINT cast_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.cast_results
ADD CONSTRAINT cast_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.caaspp_student_groups (demographic_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_cast_results_student_group
ON public.cast_results(student_group_id);
ALTER TABLE IF EXISTS public.cast_results
ADD CONSTRAINT cast_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.caaspp_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.csa_results
ADD CONSTRAINT csa_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.csa_results
ADD CONSTRAINT csa_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.caaspp_student_groups (demographic_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_csa_results_student_group
ON public.csa_results(student_group_id);
ALTER TABLE IF EXISTS public.csa_results
ADD CONSTRAINT csa_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.caaspp_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.ia_elpac_results
ADD CONSTRAINT ia_elpac_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.ia_elpac_results
ADD CONSTRAINT ia_elpac_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.elpac_student_groups (student_group_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_ia_elpac_results_student_group
ON public.ia_elpac_results(student_group_id);
ALTER TABLE IF EXISTS public.ia_elpac_results
ADD CONSTRAINT ia_elpac_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.elpac_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.items
ADD CONSTRAINT items_owner_id_fkey FOREIGN KEY (owner_id)
REFERENCES public.users (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE;
ALTER TABLE IF EXISTS public.sa_elpac_results
ADD CONSTRAINT sa_elpac_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.sa_elpac_results
ADD CONSTRAINT sa_elpac_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.elpac_student_groups (student_group_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_sa_elpac_results_student_group
ON public.sa_elpac_results(student_group_id);
ALTER TABLE IF EXISTS public.sa_elpac_results
ADD CONSTRAINT sa_elpac_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.elpac_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.sb_results
ADD CONSTRAINT sb_results_cds_code_fkey FOREIGN KEY (cds_code)
REFERENCES public.entities (cds_code) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
ALTER TABLE IF EXISTS public.sb_results
ADD CONSTRAINT sb_results_student_group_id_fkey FOREIGN KEY (student_group_id)
REFERENCES public.caaspp_student_groups (demographic_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
CREATE INDEX IF NOT EXISTS ix_sb_results_student_group
ON public.sb_results(student_group_id);
ALTER TABLE IF EXISTS public.sb_results
ADD CONSTRAINT sb_results_test_id_fkey FOREIGN KEY (test_id)
REFERENCES public.caaspp_tests (test_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
END;