forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sportsdb_tables.sql
2544 lines (1923 loc) · 70.6 KB
/
sportsdb_tables.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
--
-- PostgreSQL database dump
--
-- SET client_encoding = 'UTF-8';
-- SET check_function_bodies = false;
-- SET client_min_messages = warning;
--
-- Name: sportsdb_sample; Type: DATABASE; Schema: -; Owner: postgres81
--
-- CREATE DATABASE sportsdb_sample WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII';
-- \connect sportsdb_sample
-- SET client_encoding = 'UTF-8';
-- SET check_function_bodies = false;
-- SET client_min_messages = warning;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres81
--
-- COMMENT ON SCHEMA public IS 'Standard public schema';
-- SET search_path = public, pg_catalog;
--
-- Name: primary_id; Type: DOMAIN; Schema: public; Owner: postgres81
--
CREATE DOMAIN primary_id AS integer;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: addresses; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE addresses (
id serial NOT NULL,
location_id integer NOT NULL,
"language" character varying(100),
suite character varying(100),
floor character varying(100),
building character varying(100),
street_number character varying(100),
street_prefix character varying(100),
street character varying(100),
street_suffix character varying(100),
neighborhood character varying(100),
district character varying(100),
locality character varying(100),
county character varying(100),
region character varying(100),
postal_code character varying(100),
country character varying(100)
);
--
-- Name: addresses_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('addresses', 'id'), 1, false);
--
-- Name: affiliation_phases; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE affiliation_phases (
id serial NOT NULL,
affiliation_id integer NOT NULL,
ancestor_affiliation_id integer,
start_season_id integer,
start_date_time timestamp without time zone,
end_season_id integer,
end_date_time timestamp without time zone
);
--
-- Name: affiliation_phases_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('affiliation_phases', 'id'), 75, true);
--
-- Name: affiliations; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE affiliations (
id serial NOT NULL,
affiliation_key character varying(100) NOT NULL,
affiliation_type character varying(100),
publisher_id integer NOT NULL
);
--
-- Name: affiliations_documents; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE affiliations_documents (
affiliation_id integer NOT NULL,
document_id integer NOT NULL
);
--
-- Name: affiliations_events; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE affiliations_events (
affiliation_id integer NOT NULL,
event_id integer NOT NULL
);
--
-- Name: affiliations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('affiliations', 'id'), 29, true);
--
-- Name: affiliations_media; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE affiliations_media (
affiliation_id integer NOT NULL,
media_id integer NOT NULL
);
--
-- Name: american_football_action_participants; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_action_participants (
id serial NOT NULL,
american_football_action_play_id integer NOT NULL,
person_id integer NOT NULL,
participant_role character varying(100) NOT NULL,
score_type character varying(100),
field_line integer,
yardage integer,
score_credit integer,
yards_gained integer
);
--
-- Name: american_football_action_participants_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_action_participants', 'id'), 293, true);
--
-- Name: american_football_action_plays; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_action_plays (
id serial NOT NULL,
american_football_event_state_id integer NOT NULL,
play_type character varying(100),
score_attempt_type character varying(100),
drive_result character varying(100),
points integer,
"comment" character varying(255)
);
--
-- Name: american_football_action_plays_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_action_plays', 'id'), 179, true);
--
-- Name: american_football_defensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_defensive_stats (
id serial NOT NULL,
tackles_total character varying(100),
tackles_solo character varying(100),
tackles_assists character varying(100),
interceptions_total character varying(100),
interceptions_yards character varying(100),
interceptions_average character varying(100),
interceptions_longest character varying(100),
interceptions_touchdown character varying(100),
quarterback_hurries character varying(100),
sacks_total character varying(100),
sacks_yards character varying(100),
passes_defensed character varying(100)
);
--
-- Name: american_football_defensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_defensive_stats', 'id'), 751, true);
--
-- Name: american_football_down_progress_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_down_progress_stats (
id serial NOT NULL,
first_downs_total character varying(100),
first_downs_pass character varying(100),
first_downs_run character varying(100),
first_downs_penalty character varying(100),
conversions_third_down character varying(100),
conversions_third_down_attempts character varying(100),
conversions_third_down_percentage character varying(100),
conversions_fourth_down character varying(100),
conversions_fourth_down_attempts character varying(100),
conversions_fourth_down_percentage character varying(100)
);
--
-- Name: american_football_down_progress_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_down_progress_stats', 'id'), 36, true);
--
-- Name: american_football_event_states; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_event_states (
id serial NOT NULL,
event_id integer NOT NULL,
current_state smallint,
sequence_number integer,
period_value integer,
period_time_elapsed character varying(100),
period_time_remaining character varying(100),
clock_state character varying(100),
down integer,
team_in_possession_id integer,
distance_for_1st_down integer,
field_side character varying(100),
field_line integer,
context character varying(40)
);
--
-- Name: american_football_event_states_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_event_states', 'id'), 249, true);
--
-- Name: american_football_fumbles_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_fumbles_stats (
id serial NOT NULL,
fumbles_committed character varying(100),
fumbles_forced character varying(100),
fumbles_recovered character varying(100),
fumbles_lost character varying(100),
fumbles_yards_gained character varying(100),
fumbles_own_committed character varying(100),
fumbles_own_recovered character varying(100),
fumbles_own_lost character varying(100),
fumbles_own_yards_gained character varying(100),
fumbles_opposing_committed character varying(100),
fumbles_opposing_recovered character varying(100),
fumbles_opposing_lost character varying(100),
fumbles_opposing_yards_gained character varying(100)
);
--
-- Name: american_football_fumbles_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_fumbles_stats', 'id'), 121, true);
--
-- Name: american_football_offensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_offensive_stats (
id serial NOT NULL,
offensive_plays_yards character varying(100),
offensive_plays_number character varying(100),
offensive_plays_average_yards_per character varying(100),
possession_duration character varying(100),
turnovers_giveaway character varying(100)
);
--
-- Name: american_football_offensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_offensive_stats', 'id'), 36, true);
--
-- Name: american_football_passing_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_passing_stats (
id serial NOT NULL,
passes_attempts character varying(100),
passes_completions character varying(100),
passes_percentage character varying(100),
passes_yards_gross character varying(100),
passes_yards_net character varying(100),
passes_yards_lost character varying(100),
passes_touchdowns character varying(100),
passes_touchdowns_percentage character varying(100),
passes_interceptions character varying(100),
passes_interceptions_percentage character varying(100),
passes_longest character varying(100),
passes_average_yards_per character varying(100),
passer_rating character varying(100),
receptions_total character varying(100),
receptions_yards character varying(100),
receptions_touchdowns character varying(100),
receptions_first_down character varying(100),
receptions_longest character varying(100),
receptions_average_yards_per character varying(100)
);
--
-- Name: american_football_passing_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_passing_stats', 'id'), 301, true);
--
-- Name: american_football_penalties_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_penalties_stats (
id serial NOT NULL,
penalties_total character varying(100),
penalty_yards character varying(100),
penalty_first_downs character varying(100)
);
--
-- Name: american_football_penalties_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_penalties_stats', 'id'), 36, true);
--
-- Name: american_football_rushing_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_rushing_stats (
id serial NOT NULL,
rushes_attempts character varying(100),
rushes_yards character varying(100),
rushes_touchdowns character varying(100),
rushing_average_yards_per character varying(100),
rushes_first_down character varying(100),
rushes_longest character varying(100)
);
--
-- Name: american_football_rushing_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_rushing_stats', 'id'), 175, true);
--
-- Name: american_football_sacks_against_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_sacks_against_stats (
id serial NOT NULL,
sacks_against_yards character varying(100),
sacks_against_total character varying(100)
);
--
-- Name: american_football_sacks_against_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_sacks_against_stats', 'id'), 77, true);
--
-- Name: american_football_scoring_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_scoring_stats (
id serial NOT NULL,
touchdowns_total character varying(100),
touchdowns_passing character varying(100),
touchdowns_rushing character varying(100),
touchdowns_special_teams character varying(100),
touchdowns_defensive character varying(100),
extra_points_attempts character varying(100),
extra_points_made character varying(100),
extra_points_missed character varying(100),
extra_points_blocked character varying(100),
field_goal_attempts character varying(100),
field_goals_made character varying(100),
field_goals_missed character varying(100),
field_goals_blocked character varying(100),
safeties_against character varying(100),
two_point_conversions_attempts character varying(100),
two_point_conversions_made character varying(100),
touchbacks_total character varying(100)
);
--
-- Name: american_football_scoring_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_scoring_stats', 'id'), 842, true);
--
-- Name: american_football_special_teams_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE american_football_special_teams_stats (
id serial NOT NULL,
returns_punt_total character varying(100),
returns_punt_yards character varying(100),
returns_punt_average character varying(100),
returns_punt_longest character varying(100),
returns_punt_touchdown character varying(100),
returns_kickoff_total character varying(100),
returns_kickoff_yards character varying(100),
returns_kickoff_average character varying(100),
returns_kickoff_longest character varying(100),
returns_kickoff_touchdown character varying(100),
returns_total character varying(100),
returns_yards character varying(100),
punts_total character varying(100),
punts_yards_gross character varying(100),
punts_yards_net character varying(100),
punts_longest character varying(100),
punts_inside_20 character varying(100),
punts_inside_20_percentage character varying(100),
punts_average character varying(100),
punts_blocked character varying(100),
touchbacks_total character varying(100),
touchbacks_total_percentage character varying(100),
touchbacks_kickoffs character varying(100),
touchbacks_kickoffs_percentage character varying(100),
touchbacks_punts character varying(100),
touchbacks_punts_percentage character varying(100),
touchbacks_interceptions character varying(100),
touchbacks_interceptions_percentage character varying(100),
fair_catches character varying(100)
);
--
-- Name: american_football_special_teams_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('american_football_special_teams_stats', 'id'), 142, true);
--
-- Name: baseball_action_contact_details; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_action_contact_details (
id serial NOT NULL,
baseball_action_pitch_id integer NOT NULL,
"location" character varying(100),
strength character varying(100),
velocity integer,
"comment" text,
trajectory_coordinates character varying(100),
trajectory_formula character varying(100)
);
--
-- Name: baseball_action_contact_details_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_action_contact_details', 'id'), 1, false);
--
-- Name: baseball_action_pitches; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_action_pitches (
id serial NOT NULL,
baseball_action_play_id integer NOT NULL,
sequence_number integer,
baseball_defensive_group_id integer,
umpire_call character varying(100),
pitch_location character varying(100),
pitch_type character varying(100),
pitch_velocity integer,
"comment" text,
trajectory_coordinates character varying(100),
trajectory_formula character varying(100),
ball_type character varying(40),
strike_type character varying(40)
);
--
-- Name: baseball_action_pitches_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_action_pitches', 'id'), 1, false);
--
-- Name: baseball_action_plays; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_action_plays (
id serial NOT NULL,
baseball_event_state_id integer NOT NULL,
play_type character varying(100),
notation character varying(100),
notation_yaml text,
baseball_defensive_group_id integer,
"comment" character varying(255),
runner_on_first_advance integer,
runner_on_second_advance integer,
runner_on_third_advance integer,
outs_recorded integer,
rbi integer,
runs_scored integer,
earned_runs_scored character varying(100)
);
--
-- Name: baseball_action_plays_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_action_plays', 'id'), 17, true);
--
-- Name: baseball_action_substitutions; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_action_substitutions (
id serial NOT NULL,
baseball_event_state_id integer NOT NULL,
sequence_number integer,
person_type character varying(100),
person_original_id integer,
person_original_position_id integer,
person_original_lineup_slot integer,
person_replacing_id integer,
person_replacing_position_id integer,
person_replacing_lineup_slot integer,
substitution_reason character varying(100),
"comment" character varying(100)
);
--
-- Name: baseball_action_substitutions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_action_substitutions', 'id'), 1, false);
--
-- Name: baseball_defensive_group; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_defensive_group (
id serial NOT NULL
);
--
-- Name: baseball_defensive_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_defensive_group', 'id'), 1, false);
--
-- Name: baseball_defensive_players; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_defensive_players (
id serial NOT NULL,
baseball_defensive_group_id integer NOT NULL,
player_id integer NOT NULL,
position_id integer NOT NULL
);
--
-- Name: baseball_defensive_players_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_defensive_players', 'id'), 1, false);
--
-- Name: baseball_defensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_defensive_stats (
id serial NOT NULL,
double_plays integer,
triple_plays integer,
putouts integer,
assists integer,
errors integer,
fielding_percentage numeric,
defensive_average numeric,
errors_passed_ball integer,
errors_catchers_interference integer
);
--
-- Name: baseball_defensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_defensive_stats', 'id'), 1724, true);
--
-- Name: baseball_event_states; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_event_states (
id serial NOT NULL,
event_id integer NOT NULL,
current_state smallint,
sequence_number integer,
at_bat_number integer,
inning_value integer,
inning_half character varying(100),
outs integer,
balls integer,
strikes integer,
runner_on_first_id integer,
runner_on_second_id integer,
runner_on_third_id integer,
runner_on_first smallint,
runner_on_second smallint,
runner_on_third smallint,
runs_this_inning_half integer,
pitcher_id integer,
batter_id integer,
batter_side character varying(100),
context character varying(40)
);
--
-- Name: baseball_event_states_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_event_states', 'id'), 17, true);
--
-- Name: baseball_offensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_offensive_stats (
id serial NOT NULL,
average numeric,
runs_scored integer,
at_bats integer,
hits integer,
rbi integer,
total_bases integer,
slugging_percentage numeric,
bases_on_balls integer,
strikeouts integer,
left_on_base integer,
left_in_scoring_position integer,
singles integer,
doubles integer,
triples integer,
home_runs integer,
grand_slams integer,
at_bats_per_rbi numeric,
plate_appearances_per_rbi numeric,
at_bats_per_home_run numeric,
plate_appearances_per_home_run numeric,
sac_flies integer,
sac_bunts integer,
grounded_into_double_play integer,
moved_up integer,
on_base_percentage numeric,
stolen_bases integer,
stolen_bases_caught integer,
stolen_bases_average numeric,
hit_by_pitch integer,
defensive_interferance_reaches integer,
on_base_plus_slugging numeric,
plate_appearances integer,
hits_extra_base integer
);
--
-- Name: baseball_offensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_offensive_stats', 'id'), 1724, true);
--
-- Name: baseball_pitching_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE baseball_pitching_stats (
id serial NOT NULL,
runs_allowed integer,
singles_allowed integer,
doubles_allowed integer,
triples_allowed integer,
home_runs_allowed integer,
innings_pitched character varying(20),
hits integer,
earned_runs integer,
unearned_runs integer,
bases_on_balls integer,
bases_on_balls_intentional integer,
strikeouts integer,
strikeout_to_bb_ratio numeric,
number_of_pitches integer,
era numeric,
inherited_runners_scored integer,
pick_offs integer,
errors_hit_with_pitch integer,
errors_wild_pitch integer,
balks integer,
wins integer,
losses integer,
saves integer,
shutouts integer,
games_complete integer,
games_finished integer,
winning_percentage numeric,
event_credit character varying(40),
save_credit character varying(40)
);
--
-- Name: baseball_pitching_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('baseball_pitching_stats', 'id'), 852, true);
--
-- Name: basketball_defensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE basketball_defensive_stats (
id serial NOT NULL,
steals_total character varying(100),
steals_per_game character varying(100),
blocks_total character varying(100),
blocks_per_game character varying(100)
);
--
-- Name: basketball_defensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('basketball_defensive_stats', 'id'), 164, true);
--
-- Name: basketball_event_states; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE basketball_event_states (
id serial NOT NULL,
event_id integer NOT NULL,
current_state integer,
sequence_number integer,
period_value character varying(100),
period_time_elapsed character varying(100),
period_time_remaining character varying(100),
context character varying(40)
);
--
-- Name: basketball_event_states_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('basketball_event_states', 'id'), 1, false);
--
-- Name: basketball_offensive_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE basketball_offensive_stats (
id serial NOT NULL,
field_goals_made integer,
field_goals_attempted integer,
field_goals_percentage character varying(100),
field_goals_per_game character varying(100),
field_goals_attempted_per_game character varying(100),
field_goals_percentage_adjusted character varying(100),
three_pointers_made integer,
three_pointers_attempted integer,
three_pointers_percentage character varying(100),
three_pointers_per_game character varying(100),
three_pointers_attempted_per_game character varying(100),
free_throws_made character varying(100),
free_throws_attempted character varying(100),
free_throws_percentage character varying(100),
free_throws_per_game character varying(100),
free_throws_attempted_per_game character varying(100),
points_scored_total character varying(100),
points_scored_per_game character varying(100),
assists_total character varying(100),
assists_per_game character varying(100),
turnovers_total character varying(100),
turnovers_per_game character varying(100),
points_scored_off_turnovers character varying(100),
points_scored_in_paint character varying(100),
points_scored_on_second_chance character varying(100),
points_scored_on_fast_break character varying(100)
);
--
-- Name: basketball_offensive_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('basketball_offensive_stats', 'id'), 164, true);
--
-- Name: basketball_rebounding_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE basketball_rebounding_stats (
id serial NOT NULL,
rebounds_total character varying(100),
rebounds_per_game character varying(100),
rebounds_defensive character varying(100),
rebounds_offensive character varying(100),
team_rebounds_total character varying(100),
team_rebounds_per_game character varying(100),
team_rebounds_defensive character varying(100),
team_rebounds_offensive character varying(100)
);
--
-- Name: basketball_rebounding_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('basketball_rebounding_stats', 'id'), 164, true);
--
-- Name: basketball_team_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE basketball_team_stats (
id serial NOT NULL,
timeouts_left character varying(100),
largest_lead character varying(100),
fouls_total character varying(100),
turnover_margin character varying(100)
);
--
-- Name: basketball_team_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('basketball_team_stats', 'id'), 1, false);
--
-- Name: bookmakers; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE bookmakers (
id serial NOT NULL,
bookmaker_key character varying(100),
publisher_id integer NOT NULL,
location_id integer
);
--
-- Name: bookmakers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('bookmakers', 'id'), 1, false);
--
-- Name: core_person_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE core_person_stats (
id serial NOT NULL,
time_played_event character varying(40),
time_played_total character varying(40),
time_played_event_average character varying(40),
events_played integer,
events_started integer,
position_id integer
);
--
-- Name: core_person_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('core_person_stats', 'id'), 2588, true);
--
-- Name: core_stats; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE core_stats (
id serial NOT NULL,
score character varying(100),
score_opposing character varying(100),
score_attempts character varying(100),
score_attempts_opposing character varying(100),
score_percentage character varying(100),
score_percentage_opposing character varying(100)
);
--
-- Name: core_stats_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres81
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('core_stats', 'id'), 1, false);
--
-- Name: db_info; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE db_info (
version character varying(100) DEFAULT 16 NOT NULL
);
--
-- Name: display_names; Type: TABLE; Schema: public; Owner: postgres81; Tablespace:
--
CREATE TABLE display_names (
id serial NOT NULL,
"language" character varying(100) NOT NULL,
entity_type character varying(100) NOT NULL,
entity_id integer NOT NULL,