-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdm_ddl.sql
10231 lines (9739 loc) · 349 KB
/
sdm_ddl.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
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
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-----------------------------------------------------------
-- Export file for user SDM@DATAWH --
-- Created by espositot on 5/26/2016, 16:27:21 16:27:21 --
-----------------------------------------------------------
set define off
spool sdm_ddl.log
prompt
prompt Creating table ABSENCE_FACT
prompt ===========================
prompt
create table SDM.ABSENCE_FACT
(
loc_county_dist_id VARCHAR2(6) not null,
record_type VARCHAR2(1) not null,
date_sid NUMBER,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
period VARCHAR2(8) not null,
event_type VARCHAR2(20),
process_dt DATE not null,
inactive_record NUMBER(1),
conformed_event_type VARCHAR2(30),
ada_cnt NUMBER(2,1)
)
partition by range (DATE_SID)
(
partition CATCH_111111_All values less than (297910)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
),
partition ROYSE_199902_PAST values less than (309234)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
),
partition ROYSE_199902_PRIOR values less than (309599)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
),
partition ROYSE_199902_CURRENT values less than (316539)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
),
partition CATCH_999999_All values less than (99999999)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
);
create bitmap index SDM.BMI_P_CDC_ABS_FACT on SDM.ABSENCE_FACT (LOC_COUNTY_DIST_ID)
nologging local;
create bitmap index SDM.BMI_P_DATE_SID_ABS_FACT on SDM.ABSENCE_FACT (DATE_SID)
nologging local;
create bitmap index SDM.BMI_P_LOC_SID_ABS_FACT on SDM.ABSENCE_FACT (LOC_SID)
nologging local;
create bitmap index SDM.BMI_P_STU_SID_ABS_FACT on SDM.ABSENCE_FACT (STU_SID)
nologging local;
prompt
prompt Creating table ABSENCE_FACT_PART_MOVE
prompt =====================================
prompt
create table SDM.ABSENCE_FACT_PART_MOVE
(
loc_county_dist_id VARCHAR2(6) not null,
record_type VARCHAR2(1) not null,
date_sid NUMBER,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
period VARCHAR2(8) not null,
event_type VARCHAR2(20),
process_dt DATE not null,
inactive_record NUMBER(1),
conformed_event_type VARCHAR2(30),
ada_cnt NUMBER(2,1)
)
tablespace DW_DEFAULT01
pctfree 0
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
prompt
prompt Creating table ABSENCE_FACT_PRIORYR
prompt ===================================
prompt
create table SDM.ABSENCE_FACT_PRIORYR
(
loc_county_dist_id VARCHAR2(6) not null,
record_type VARCHAR2(1) not null,
date_sid NUMBER,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
period VARCHAR2(8) not null,
event_type VARCHAR2(20),
process_dt DATE not null,
inactive_record NUMBER(1),
ada_cnt NUMBER(2,1),
conformed_event_type VARCHAR2(30)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
prompt
prompt Creating table ABSENCE_FACT_TEMP
prompt ================================
prompt
create table SDM.ABSENCE_FACT_TEMP
(
loc_county_dist_id VARCHAR2(6) not null,
record_type VARCHAR2(1) not null,
date_sid NUMBER,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
period VARCHAR2(8) not null,
event_type VARCHAR2(20),
process_dt DATE not null,
inactive_record NUMBER(1),
conformed_event_type VARCHAR2(30),
ada_cnt NUMBER(2,1)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
prompt
prompt Creating table ABSENCE_SUMMARY_FACT
prompt ===================================
prompt
create table SDM.ABSENCE_SUMMARY_FACT
(
record_key VARCHAR2(50) not null,
loc_county_dist_id VARCHAR2(6) not null,
date_sid NUMBER(8) not null,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
day_abs_cnt NUMBER(7),
day_non_cnt NUMBER(7),
day_non_prd_cnt NUMBER(7),
day_abs_prd_cnt NUMBER(7),
process_dt DATE
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.BMI_STU_SID_ABS_SUM_FACT on SDM.ABSENCE_SUMMARY_FACT (STU_SID)
tablespace DW_DEFAULT01
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
prompt
prompt Creating table ABS_FACT_MISSING_ENRL
prompt ====================================
prompt
create table SDM.ABS_FACT_MISSING_ENRL
(
loc_county_dist_id VARCHAR2(6) not null,
record_type VARCHAR2(1) not null,
date_sid NUMBER,
stu_sid NUMBER(9) not null,
loc_sid NUMBER(6) not null,
period VARCHAR2(8) not null,
event_type VARCHAR2(20),
process_dt DATE not null,
inactive_record NUMBER(1),
conformed_event_type VARCHAR2(30),
ada_cnt NUMBER(2,1)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
prompt
prompt Creating table COURSE_DIM
prompt =========================
prompt
create table SDM.COURSE_DIM
(
course_sid NUMBER(6) not null,
loc_county_dist_id VARCHAR2(6) not null,
course_key VARCHAR2(35) not null,
school_year NUMBER(4) not null,
course_id VARCHAR2(15) not null,
course_ext VARCHAR2(5),
course_desc VARCHAR2(60),
course_type VARCHAR2(25),
first_elgbl_grd VARCHAR2(2),
last_elgbl_grd VARCHAR2(2),
course_adopted_dt VARCHAR2(21),
course_updated_dt VARCHAR2(21),
course_deleted_dt VARCHAR2(21),
course_dept VARCHAR2(20),
course_subject_area VARCHAR2(25),
state_course_cd VARCHAR2(10),
state_course_desc VARCHAR2(150),
create_dt DATE not null,
last_updt_dt DATE not null,
eff_start_dt DATE,
eff_end_dt DATE,
cur_indicator VARCHAR2(1) not null,
conformed_course_type VARCHAR2(20),
conformed_department VARCHAR2(30),
conformed_subject VARCHAR2(50),
conformed_course_description VARCHAR2(150)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
comment on column SDM.COURSE_DIM.loc_county_dist_id
is 'COUNTY DISTRICT CODE indicates a code for the district providing service to the student. Each school district in Texas is assigned a unique COUNTY DISTRICT CODE by the Texas Education Agency. (TEA)';
comment on column SDM.COURSE_DIM.course_key
is 'COURSE KEY indicates the key that defines the course record.';
comment on column SDM.COURSE_DIM.school_year
is 'SCHOOL YEAR indicates the ending year for the school year range for which this record is valid.';
comment on column SDM.COURSE_DIM.course_id
is 'COURSE ID indicates the actual physical ID that identifies the unique course number for the school.';
comment on column SDM.COURSE_DIM.course_ext
is 'COURSE EXTENSION indicates the course extension of the Course ID.';
comment on column SDM.COURSE_DIM.course_desc
is 'COURSE DESCRIPTION identifies the description of the course as it appears in the scholastic course guide for the district.';
comment on column SDM.COURSE_DIM.course_type
is 'COURSE TYPE indicates the type of scholastic program to which this course is connected.';
comment on column SDM.COURSE_DIM.first_elgbl_grd
is 'COURSE FIRST ELIGIBLE GRADE is the grade level for which this course if first made available.';
comment on column SDM.COURSE_DIM.last_elgbl_grd
is 'COURSE LAST ELIGIBLE GRADE is the grade level for which this course is last made available.';
comment on column SDM.COURSE_DIM.course_adopted_dt
is 'COURSE ADOPTED DATE indicates the date the course was adopted in the district within the current school year.';
comment on column SDM.COURSE_DIM.course_updated_dt
is 'COURSE UPDATED DATE indicates the date on which the course was updated in the district within the current school year.';
comment on column SDM.COURSE_DIM.course_deleted_dt
is 'COURSE REMOVED DATE indicates the date on which the course was deleted from the district''s list of available courses with the current school year.';
comment on column SDM.COURSE_DIM.course_dept
is 'DEPARTMENT indicates the primary department to which the course is assigned.';
comment on column SDM.COURSE_DIM.course_subject_area
is 'COURSE SUBJECT AREA indicates the subject area of the course.';
comment on column SDM.COURSE_DIM.state_course_cd
is 'STATE COURSE CD indicates the PEIMS Service ID Code.';
comment on column SDM.COURSE_DIM.state_course_desc
is 'STATE COURSE DESC indicates the description of the PEIMS Service ID code.';
create bitmap index SDM.BMI_CDC_COURSE_DIM on SDM.COURSE_DIM (LOC_COUNTY_DIST_ID)
tablespace DW_DEFAULT01
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
alter table SDM.COURSE_DIM
add constraint PK_COURSE_DIM primary key (COURSE_SID)
using index
tablespace DW_DEFAULT01
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
alter index SDM.PK_COURSE_DIM nologging;
prompt
prompt Creating table CURRENT_INSERTS_TBL
prompt ==================================
prompt
create table SDM.CURRENT_INSERTS_TBL
(
district_id VARCHAR2(10),
insert_cnt NUMBER,
table_name VARCHAR2(100),
process_dt VARCHAR2(30),
create_dt DATE default sysdate
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
);
prompt
prompt Creating table CURRENT_REJECTS_TBL
prompt ==================================
prompt
create table SDM.CURRENT_REJECTS_TBL
(
district_id VARCHAR2(10),
reason VARCHAR2(1000),
reject_cnt NUMBER,
table_name VARCHAR2(100),
process_dt VARCHAR2(30),
create_dt DATE default sysdate
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
);
prompt
prompt Creating table CUR_REJ_ENROLLMENT_FACT
prompt ======================================
prompt
create table SDM.CUR_REJ_ENROLLMENT_FACT
(
"reason" VARCHAR2(255 CHAR) not null,
loc_county_dist_id VARCHAR2(6 CHAR) not null,
loc_sid VARCHAR2(15 CHAR) not null,
stu_sid VARCHAR2(40 CHAR) not null,
date_sid VARCHAR2(15 CHAR),
process_dt VARCHAR2(10 CHAR),
inactive_record NUMBER(5),
cnt NUMBER(5),
ada_enr_cnt NUMBER(10,1),
stu_lep_code VARCHAR2(2 CHAR),
stu_race VARCHAR2(1 CHAR),
stu_free_redu_lnch NUMBER(5),
stu_cur_grd_lvl VARCHAR2(25 CHAR),
stu_primary_ese_cd VARCHAR2(2 CHAR),
race_ethnicity_sid NUMBER(5)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
);
prompt
prompt Creating table DATE_DIM
prompt =======================
prompt
create table SDM.DATE_DIM
(
district_id VARCHAR2(6) not null,
district_sid NUMBER(4) not null,
date_sid NUMBER(8) not null,
date_id DATE not null,
date_key VARCHAR2(15) not null,
calendar_month VARCHAR2(2) not null,
calendar_month_name VARCHAR2(9) not null,
calendar_month_short_name VARCHAR2(3) not null,
calendar_quarter VARCHAR2(1) not null,
calendar_week VARCHAR2(2) not null,
calendar_year VARCHAR2(4) not null,
calendar_year_month VARCHAR2(6) not null,
calendar_year_quarter VARCHAR2(7) not null,
day_of_week VARCHAR2(1) not null,
day_of_week_name VARCHAR2(9) not null,
day_of_week_short_name VARCHAR2(3) not null,
fiscal_period VARCHAR2(2),
fiscal_quarter VARCHAR2(1),
fiscal_year VARCHAR2(4),
fiscal_year_quarter VARCHAR2(7),
long_date VARCHAR2(18) not null,
school_day_indicator VARCHAR2(13),
school_week VARCHAR2(2),
school_year VARCHAR2(4) not null,
school_year_description VARCHAR2(9) not null,
semester VARCHAR2(1),
short_date VARCHAR2(10) not null,
snapshot_date_indicator VARCHAR2(3),
weekly_enrollment_date_flag VARCHAR2(3),
most_recent_enrollment_flag VARCHAR2(3),
year_month_day VARCHAR2(8) not null,
academic_6_weeks VARCHAR2(1),
academic_9_weeks VARCHAR2(1),
academic_day NUMBER(3),
academic_week VARCHAR2(2),
first_day_academic_6_weeks VARCHAR2(3),
last_day_academic_6_weeks VARCHAR2(3),
first_day_academic_9_weeks VARCHAR2(3),
last_day_academic_9_weeks VARCHAR2(3),
first_day_semester VARCHAR2(3),
last_day_semester VARCHAR2(3),
discipline_reporting_period VARCHAR2(1),
day_desc VARCHAR2(28),
day_nbr NUMBER(2),
day_short_desc VARCHAR2(16),
dow_desc VARCHAR2(9),
dow_nbr NUMBER(1),
dow_short_desc VARCHAR2(3),
julian_dt NUMBER(7),
month_desc VARCHAR2(9),
month_id NUMBER(6),
month_nbr NUMBER(2),
month_short_desc VARCHAR2(3),
schl_week NUMBER(2),
schl_year NUMBER(4),
schl_year_desc VARCHAR2(9),
week_num NUMBER(2),
year_desc VARCHAR2(6),
year_id NUMBER(4),
yyyymmdd VARCHAR2(8)
)
tablespace DW_DEFAULT01
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX1 on SDM.DATE_DIM (DISTRICT_SID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX2 on SDM.DATE_DIM (DATE_ID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX3 on SDM.DATE_DIM (CALENDAR_MONTH)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX4 on SDM.DATE_DIM (CALENDAR_MONTH_NAME)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX5 on SDM.DATE_DIM (CALENDAR_MONTH_SHORT_NAME)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX6 on SDM.DATE_DIM (CALENDAR_YEAR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX7 on SDM.DATE_DIM (FISCAL_PERIOD)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX8 on SDM.DATE_DIM (FISCAL_QUARTER)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IX9 on SDM.DATE_DIM (FISCAL_YEAR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXA on SDM.DATE_DIM (SCHOOL_DAY_INDICATOR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXB on SDM.DATE_DIM (SCHOOL_WEEK)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXC on SDM.DATE_DIM (SCHOOL_YEAR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXD on SDM.DATE_DIM (SEMESTER)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXE on SDM.DATE_DIM (SNAPSHOT_DATE_INDICATOR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXF on SDM.DATE_DIM (WEEKLY_ENROLLMENT_DATE_FLAG)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXG on SDM.DATE_DIM (MOST_RECENT_ENROLLMENT_FLAG)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXH on SDM.DATE_DIM (YEAR_MONTH_DAY)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXI on SDM.DATE_DIM (ACADEMIC_6_WEEKS)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXJ on SDM.DATE_DIM (ACADEMIC_9_WEEKS)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXK on SDM.DATE_DIM (ACADEMIC_DAY)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXL on SDM.DATE_DIM (ACADEMIC_WEEK)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXM on SDM.DATE_DIM (YYYYMMDD)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXN on SDM.DATE_DIM (MONTH_ID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXO on SDM.DATE_DIM (MONTH_NBR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXP on SDM.DATE_DIM (SCHL_WEEK)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXQ on SDM.DATE_DIM (SCHL_YEAR)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXR on SDM.DATE_DIM (YEAR_ID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXT on SDM.DATE_DIM (MONTH_DESC)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXU on SDM.DATE_DIM (WEEK_NUM)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXV on SDM.DATE_DIM (YEAR_DESC)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create bitmap index SDM.DATE_DIM_IXW on SDM.DATE_DIM (DISTRICT_ID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
create unique index SDM.UI_DATE_DIM_PK on SDM.DATE_DIM (DATE_SID)
tablespace DW_DEFAULT_INDEX
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
nologging;
alter table SDM.DATE_DIM
add constraint DATE_DIM_PK primary key (DATE_SID);
grant select on SDM.DATE_DIM to PUBLIC;
prompt
prompt Creating table DATE_DIM_NEW
prompt ===========================
prompt
create table SDM.DATE_DIM_NEW
(
date_id DATE,
year_id NUMBER,
month_id FLOAT,
year_desc VARCHAR2(255 CHAR),
month_nbr FLOAT,
month_desc VARCHAR2(255 CHAR),
month_short_desc VARCHAR2(255 CHAR),
day_nbr FLOAT,
day_desc VARCHAR2(255 CHAR),
day_short_desc VARCHAR2(255 CHAR),
dow_nbr FLOAT,
dow_desc VARCHAR2(255 CHAR),
dow_short_desc VARCHAR2(255 CHAR),
julian_dt FLOAT,
schl_year NUMBER,
fiscal_year VARCHAR2(80 CHAR),
fiscal_period VARCHAR2(80 CHAR),
schl_year_desc VARCHAR2(255 CHAR),
elem_grd_period VARCHAR2(255 CHAR),
middle_grd_period VARCHAR2(255 CHAR),
high_grd_period VARCHAR2(255 CHAR),
adult_grd_period FLOAT,
djj_grd_period FLOAT,
elem_trimester FLOAT,
sec_semester VARCHAR2(255 CHAR),
sec_nine_weeks VARCHAR2(255 CHAR),
holiday FLOAT,
schl_day_ct_1 FLOAT,
schl_day_ct_2 FLOAT,
schl_day_ct_3 FLOAT,
schl_day_ct_4 FLOAT,
schl_day_ct_5 FLOAT,
schl_day_ct_6 FLOAT,
schl_day_ct_7 FLOAT,
schl_day_ct_8 FLOAT,
schl_day_ct_9 FLOAT,
schl_day_ct_10 FLOAT,
date_sid INTEGER not null
)
tablespace DW_DEFAULT01
pctfree 10