CREATE TABLE IF NOT EXISTS sport (
    "id" INT,
    "code" TEXT,
    "link" TEXT,
    "name" TEXT,
    "abbreviation" TEXT,
    "sortOrder" INT,
    "activeStatus" TEXT
);
INSERT INTO sport VALUES
    (1,'mlb','/api/v1/sports/1','Major League Baseball','MLB',11,'True'),
    (11,'aaa','/api/v1/sports/11','Triple-A','AAA',101,'True'),
    (12,'aax','/api/v1/sports/12','Double-A','AA',201,'True'),
    (13,'afa','/api/v1/sports/13','High-A','A+',301,'True'),
    (14,'afx','/api/v1/sports/14','Single-A','A',401,'True'),
    (16,'rok','/api/v1/sports/16','Rookie','ROK',701,'True'),
    (17,'win','/api/v1/sports/17','Winter Leagues','WIN',1301,'True'),
    (8,'bbl','/api/v1/sports/8','Organized Baseball','Pros',1401,'True'),
    (21,'min','/api/v1/sports/21','Minor League Baseball','Minors',1402,'True'),
    (23,'ind','/api/v1/sports/23','Independent Leagues','IND',2101,'True'),
    (51,'int','/api/v1/sports/51','International Baseball','INT',3501,'True'),
    (509,'nae','/api/v1/sports/509','International Baseball (18U)','18U',3503,'True'),
    (510,'nas','/api/v1/sports/510','International Baseball (16 and under)','16U',3505,'True'),
    (22,'bbc','/api/v1/sports/22','College Baseball','College',5101,'True'),
    (586,'hsb','/api/v1/sports/586','High School Baseball','H.S.',6201,'True');

CREATE TABLE IF NOT EXISTS season (
    "sportId" INT,
    "seasonId" INT,
    "hasWildcard" TEXT,
    "preSeasonStartDate" TIMESTAMP,
    "preSeasonEndDate" TIMESTAMP,
    "seasonStartDate" TIMESTAMP,
    "springStartDate" TIMESTAMP,
    "springEndDate" TIMESTAMP,
    "regularSeasonStartDate" TIMESTAMP,
    "lastDate1stHalf" TIMESTAMP,
    "allStarDate" TIMESTAMP,
    "firstDate2ndHalf" TIMESTAMP,
    "regularSeasonEndDate" TIMESTAMP,
    "postSeasonStartDate" TIMESTAMP,
    "postSeasonEndDate" TIMESTAMP,
    "seasonEndDate" TIMESTAMP,
    "offseasonStartDate" TIMESTAMP,
    "offSeasonEndDate" TIMESTAMP,
    "seasonLevelGamedayType" TEXT,
    "gameLevelGamedayType" TEXT,
    "qualifierPlateAppearances" NUMERIC(2, 1),
    "qualifierOutsPitched" NUMERIC(5, 1)
);
INSERT INTO season VALUES
    (1,2023,'True','2023-01-01 00:00:00','2023-02-23 00:00:00','2023-02-24 00:00:00','2023-02-24 00:00:00','2023-03-28 00:00:00','2023-03-30 00:00:00','2023-07-09 00:00:00','2023-07-11 00:00:00','2023-07-14 00:00:00','2023-10-01 00:00:00','2023-10-03 00:00:00','2023-10-31 00:00:00','2023-10-31 00:00:00','2023-11-01 00:00:00','2023-12-31 00:00:00','P','P',3.1,6000.0),
    (11,2023,'False','2023-01-01 00:00:00','2023-03-30 00:00:00','2023-03-31 00:00:00',NULL,NULL,'2023-03-31 00:00:00',NULL,NULL,NULL,'2023-09-24 00:00:00','2023-09-25 00:00:00','2023-10-02 00:00:00','2023-10-02 00:00:00','2023-10-03 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,3000.0),
    (12,2023,'False','2023-01-01 00:00:00','2023-04-05 00:00:00','2023-04-06 00:00:00',NULL,NULL,'2023-04-06 00:00:00','2023-06-26 00:00:00',NULL,'2023-06-28 00:00:00','2023-09-17 00:00:00','2023-09-18 00:00:00','2023-09-28 00:00:00','2023-09-28 00:00:00','2023-09-29 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,3000.0),
    (13,2023,'False','2022-10-25 00:00:00','2022-10-25 00:00:00','2023-04-06 00:00:00',NULL,NULL,'2023-04-06 00:00:00','2023-06-23 00:00:00',NULL,'2023-06-24 00:00:00','2023-09-10 00:00:00','2023-09-11 00:00:00','2023-09-19 00:00:00','2023-09-19 00:00:00','2023-09-20 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,3000.0),
    (14,2023,'False','2023-01-01 00:00:00','2023-04-05 00:00:00','2023-04-06 00:00:00',NULL,NULL,'2023-04-06 00:00:00','2023-06-23 00:00:00',NULL,'2023-06-24 00:00:00','2023-09-10 00:00:00','2023-09-11 00:00:00','2023-09-19 00:00:00','2023-09-19 00:00:00','2023-09-20 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,1500.0),
    (16,2023,'True','2023-01-01 00:00:00','2023-06-05 00:00:00','2023-06-06 00:00:00',NULL,NULL,'2023-06-06 00:00:00',NULL,NULL,NULL,'2023-08-23 00:00:00','2023-08-24 00:00:00','2023-08-30 00:00:00','2023-08-30 00:00:00','2023-08-31 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,1500.0),
    (17,2023,'True','2023-10-01 00:00:00','2023-10-02 00:00:00','2023-10-03 00:00:00',NULL,NULL,'2023-10-03 00:00:00',NULL,NULL,NULL,'2024-02-10 00:00:00',NULL,NULL,'2024-02-10 00:00:00','2024-02-11 00:00:00','2024-09-30 00:00:00','A','Y',2.7,3300.0),
    (21,2023,'False','2023-01-01 00:00:00',NULL,'2023-01-01 00:00:00',NULL,NULL,'2023-01-01 00:00:00',NULL,NULL,NULL,'2023-12-31 00:00:00',NULL,NULL,'2023-12-31 00:00:00',NULL,'2023-12-31 00:00:00','A','A',NULL,NULL),
    (23,2023,'True','2023-01-01 00:00:00','2023-04-27 00:00:00','2023-04-28 00:00:00',NULL,NULL,'2023-04-28 00:00:00',NULL,NULL,NULL,'2023-09-17 00:00:00',NULL,NULL,'2023-09-17 00:00:00','2023-10-03 00:00:00','2023-12-31 00:00:00','A','A',2.7,2.4),
    (51,2023,'False','2023-01-01 00:00:00','2023-03-06 00:00:00','2023-03-07 00:00:00',NULL,NULL,'2023-03-07 00:00:00',NULL,NULL,NULL,'2023-10-05 00:00:00',NULL,NULL,'2023-10-05 00:00:00','2023-10-06 00:00:00','2023-12-31 00:00:00','Y','Y',NULL,NULL),
    (22,2023,'False','2023-01-01 00:00:00','2023-02-10 00:00:00','2023-02-11 00:00:00',NULL,NULL,'2023-02-11 00:00:00',NULL,NULL,NULL,'2023-09-06 00:00:00',NULL,NULL,'2023-09-06 00:00:00','2023-09-07 00:00:00','2023-12-31 00:00:00','Y','Y',2.7,1500.0),
    (586,2023,'False','2023-01-01 00:00:00',NULL,'2023-01-01 00:00:00',NULL,NULL,'2023-01-01 00:00:00',NULL,NULL,NULL,'2023-12-31 00:00:00',NULL,NULL,'2023-12-31 00:00:00',NULL,'2023-12-31 00:00:00','N','N',NULL,NULL);

CREATE TABLE IF NOT EXISTS league (
    "id" INT,
    "name" TEXT,
    "link" TEXT,
    "abbreviation" TEXT,
    "nameShort" TEXT,
    "seasonState" TEXT,
    "hasWildCard" TEXT,
    "hasSplitSeason" TEXT,
    "numGames" INT,
    "hasPlayoffPoints" TEXT,
    "numTeams" INT,
    "numWildcardTeams" INT,
    "orgCode" TEXT,
    "conferencesInUse" TEXT,
    "divisionsInUse" TEXT,
    "sportId" INT,
    "sortOrder" INT,
    "active" TEXT
);
INSERT INTO league VALUES
    (103,'American League','/api/v1/league/103','AL','American','offseason','True','False',162,'False',15,3,'AL','False','True',1,21,'True'),
    (104,'National League','/api/v1/league/104','NL','National','offseason','True','False',162,'False',15,3,'NL','False','True',1,31,'True'),
    (114,'Cactus League','/api/v1/league/114','CL','Cactus','offseason','False','False',NULL,'False',NULL,NULL,'CL','False','False',NULL,51,'True'),
    (115,'Grapefruit League','/api/v1/league/115','GL','Grapefruit','offseason','False','False',NULL,'False',NULL,NULL,'GL','False','False',NULL,52,'True'),
    (100,'American Association','/api/v1/league/100','AA',NULL,'offseason','False','False',NULL,NULL,9,NULL,'AA','False','False',1,2811,'False'),
    (105,'Players League','/api/v1/league/105','PL',NULL,'offseason','False','False',NULL,NULL,8,NULL,'PL','False','False',1,2831,'False'),
    (101,'Union Association','/api/v1/league/101','UA',NULL,'offseason','False','False',NULL,NULL,12,NULL,'UA','False','False',1,2841,'False'),
    (106,'Federal League','/api/v1/league/106','FL',NULL,'offseason','False','False',154,NULL,8,NULL,'FL','False','False',1,2851,'False');

CREATE TABLE IF NOT EXISTS division (
    "id" INT,
    "name" TEXT,
    "season" INT,
    "nameShort" TEXT,
    "link" TEXT,
    "abbreviation" TEXT,
    "leagueId" INT,
    "sportId" INT,
    "hasWildcard" TEXT,
    "sortOrder" INT,
    "numPlayoffTeams" INT,
    "active" TEXT
);
INSERT INTO division VALUES
    (205,'National League Central',2022,'NL Central','/api/v1/divisions/205','NLC',104,1,'False',33,1,'True'),
    (200,'American League West',2022,'AL West','/api/v1/divisions/200','ALW',103,1,'False',24,1,'True'),
    (233,'Pacific Coast League East',2022,'PCL East','/api/v1/divisions/233','PCLE',112,11,'False',122,1,'True'),
    (212,'Eastern League Northeast',2022,'EAS Northeast','/api/v1/divisions/212','EASNE',113,12,'False',213,1,'True'),
    (201,'American League East',2022,'AL East','/api/v1/divisions/201','ALE',103,1,'False',22,1,'True'),
    (204,'National League East',2022,'NL East','/api/v1/divisions/204','NLE',104,1,'False',32,1,'True'),
    (202,'American League Central',2022,'AL Central','/api/v1/divisions/202','ALC',103,1,'False',23,1,'True'),
    (241,'Texas League North',2022,'TEX North','/api/v1/divisions/241','TEXN',109,12,'False',233,1,'True'),
    (239,'Southern League North',2022,'SOU North','/api/v1/divisions/239','SOUN',111,12,'False',223,1,'True'),
    (203,'National League West',2022,'NL West','/api/v1/divisions/203','NLW',104,1,'False',34,1,'True'),
    (219,'International League East',2022,'INT East','/api/v1/divisions/219','INTE',117,11,'False',112,1,'True'),
    (222,'Mexican League Norte',2022,'MEX Norte','/api/v1/divisions/222','MEXN',125,23,'False',2127,5,'True'),
    (223,'Mexican League Sur',2022,'MEX Sur','/api/v1/divisions/223','MEXS',125,23,'False',2128,5,'True'),
    (221,'International League West',2022,'INT West','/api/v1/divisions/221','INTW',117,11,'False',114,1,'True'),
    (231,'Pacific Coast League West',2022,'PCL West','/api/v1/divisions/231','PCLW',112,11,'False',123,1,'True'),
    (213,'Eastern League Southwest',2022,'EAS Southwest','/api/v1/divisions/213','EASSW',113,12,'False',215,1,'True'),
    (240,'Southern League South',2022,'SOU South','/api/v1/divisions/240','SOUS',111,12,'False',225,1,'True'),
    (242,'Texas League South',2022,'TEX South','/api/v1/divisions/242','TEXS',109,12,'False',235,1,'True'),
    (208,'California League North',2022,'CAL North','/api/v1/divisions/208','CALN',110,14,'False',433,1,'True'),
    (224,'Midwest League East',2022,'MID East','/api/v1/divisions/224','MIDE',118,13,'False',323,1,'True'),
    (237,'South Atlantic League North',2022,'SAL North','/api/v1/divisions/237','SALN',116,13,'False',313,1,'True'),
    (214,'Florida State League East',2022,'FSL East','/api/v1/divisions/214','FSLE',123,14,'False',423,1,'True'),
    (209,'California League South',2022,'CAL South','/api/v1/divisions/209','CALS',110,14,'False',435,1,'True'),
    (215,'Florida State League West',2022,'FSL West','/api/v1/divisions/215','FSLW',123,14,'False',425,1,'True'),
    (225,'Midwest League West',2022,'MID West','/api/v1/divisions/225','MIDW',118,13,'False',325,1,'True'),
    (238,'South Atlantic League South',2022,'SAL South','/api/v1/divisions/238','SALS',116,13,'False',315,1,'True'),
    (210,'Carolina League North',2022,'CAR North','/api/v1/divisions/210','CARN',122,14,'False',413,1,'True'),
    (247,'Dominican Summer League North',2022,'DSL North','/api/v1/divisions/247','DSLN',130,16,'False',732,1,'True'),
    (211,'Carolina League South',2022,'CAR South','/api/v1/divisions/211','CARS',122,14,'False',417,1,'True'),
    (316,'WBC Qualifier 1',2022,'WBC Qualifier 1','/api/v1/divisions/316','WBC Q1',159,51,'False',3619,NULL,'True'),
    (317,'WBC Qualifier 2',2022,'WBC Qualifier 2','/api/v1/divisions/317','WBC Q2',159,51,'False',3620,NULL,'True'),
    (310,'Pool A',2021,'Pool A','/api/v1/divisions/310','Pool A',160,51,'False',3612,NULL,'True'),
    (311,'Pool B',2021,'Pool B','/api/v1/divisions/311','Pool B',160,51,'False',3613,NULL,'True'),
    (312,'Pool C',2021,'Pool C','/api/v1/divisions/312','Pool C',160,51,'False',3614,NULL,'True'),
    (313,'Pool D',2021,'Pool D','/api/v1/divisions/313','Pool D',160,51,'False',3615,NULL,'True'),
    (314,'Asia Quarterfinals',2021,'Asia Quarterfinals','/api/v1/divisions/314','AQ',160,51,'False',3617,2,'True'),
    (315,'North America Quarterfinals',2021,'N.A. Quarterfinals','/api/v1/divisions/315','NAQ',160,51,'False',3618,2,'True'),
    (217,'Florida Complex League North',2022,'FCL North','/api/v1/divisions/217','FCLN',124,16,'False',725,1,'True'),
    (248,'Dominican Summer League South',2022,'DSL South','/api/v1/divisions/248','DSLS',130,16,'False',733,1,'True'),
    (216,'Florida Complex League East',2022,'FCL East','/api/v1/divisions/216','FCLE',124,16,'False',723,1,'True'),
    (249,'Dominican Summer League Northwest',2022,'DSL Northwest','/api/v1/divisions/249','DSLNW',130,16,'False',735,1,'True'),
    (218,'Florida Complex League South',2022,'FCL South','/api/v1/divisions/218','FCLS',124,16,'False',729,1,'True'),
    (250,'Dominican Summer League Baseball City',2022,'DSL Baseball City','/api/v1/divisions/250','DSLBC',130,16,'False',736,1,'True'),
    (246,'Dominican Summer League San Pedro',2022,'DSL San Pedro','/api/v1/divisions/246','DSLSP',130,16,'False',737,1,'True'),
    (401,'Dominican Summer League Northeast',2022,'DSL Northeast','/api/v1/divisions/401','DSLNE',130,16,'False',734,1,'True'),
    (251,'Arizona Fall League East',2021,'AFL East','/api/v1/divisions/251','AFLE',119,17,'False',1312,1,'True'),
    (252,'Arizona Fall League West',2021,'AFL West','/api/v1/divisions/252','AFLW',119,17,'False',1313,1,'True'),
    (560,'Arizona Complex League East',2022,'ACL East','/api/v1/divisions/560','ACLE',121,16,'False',713,1,'True'),
    (561,'Arizona Complex League West',2022,'ACL West','/api/v1/divisions/561','ACLW',121,16,'False',717,1,'True'),
    (410,'LVBP Central Division',2020,'LVBP Oriental','/api/v1/divisions/410','ORI',135,17,'False',1336,2,'True'),
    (411,'LVBP Occidental Division',2020,'LVBP Occidental','/api/v1/divisions/411','OCC',135,17,'False',1339,2,'True'),
    (5418,'Australian Baseball League Northeast',2022,'Australian Lg. NE','/api/v1/divisions/5418','ABL NE',595,17,'False',1362,2,'True'),
    (5419,'Australian Baseball League Southwest',2022,'Australian Lg. SW','/api/v1/divisions/5419','ABL SW',595,17,'False',1363,2,'True'),
    (570,'Arizona Complex League Central',2022,'ACL Central','/api/v1/divisions/570','ACLC',121,16,'False',715,1,'True'),
    (5436,'South Division',2022,'South','/api/v1/divisions/5436','ALPBS',436,23,'False',2123,1,'True'),
    (5437,'North Division',2022,'North','/api/v1/divisions/5437','ALPBN',436,23,'False',2122,1,'True');

CREATE TABLE IF NOT EXISTS venue (
    "id" INT,
    "name" TEXT,
    "link" TEXT,
    "active" TEXT
);
INSERT INTO venue VALUES
    (1,'Angel Stadium','/api/v1/venues/1','True'),
    (2,'Oriole Park at Camden Yards','/api/v1/venues/2','True'),
    (3,'Fenway Park','/api/v1/venues/3','True'),
    (5380,'CoolToday Park','/api/v1/venues/5380','True'),
    (4,'Guaranteed Rate Field','/api/v1/venues/4','True'),
    (5,'Progressive Field','/api/v1/venues/5','True'),
    (7,'Kauffman Stadium','/api/v1/venues/7','True'),
    (5000,'The Ballpark of the Palm Beaches','/api/v1/venues/5000','True'),
    (10,'Oakland Coliseum','/api/v1/venues/10','True'),
    (12,'Tropicana Field','/api/v1/venues/12','True'),
    (2700,'BayCare Ballpark','/api/v1/venues/2700','True'),
    (14,'Rogers Centre','/api/v1/venues/14','True'),
    (15,'Chase Field','/api/v1/venues/15','True'),
    (17,'Wrigley Field','/api/v1/venues/17','True'),
    (19,'Coors Field','/api/v1/venues/19','True'),
    (4629,'Sloan Park','/api/v1/venues/4629','True'),
    (22,'Dodger Stadium','/api/v1/venues/22','True'),
    (4249,'Salt River Fields at Talking Stick','/api/v1/venues/4249','True'),
    (31,'PNC Park','/api/v1/venues/31','True'),
    (32,'American Family Field','/api/v1/venues/32','True'),
    (2856,'Clover Park','/api/v1/venues/2856','True'),
    (680,'T-Mobile Park','/api/v1/venues/680','True'),
    (2602,'Great American Ball Park','/api/v1/venues/2602','True'),
    (2603,'Surprise Stadium','/api/v1/venues/2603','True'),
    (2862,'Hammond Stadium','/api/v1/venues/2862','True'),
    (2735,'Muncy Bank Ballpark','/api/v1/venues/2735','True'),
    (2500,'Tempe Diablo Stadium','/api/v1/venues/2500','True'),
    (5445,'Field of Dreams','/api/v1/venues/5445','True'),
    (4169,'loanDepot park','/api/v1/venues/4169','True'),
    (2889,'Busch Stadium','/api/v1/venues/2889','True'),
    (2507,'Hohokam Stadium','/api/v1/venues/2507','True'),
    (2508,'Ed Smith Stadium','/api/v1/venues/2508','True'),
    (5325,'Globe Life Field','/api/v1/venues/5325','True'),
    (2511,'Publix Field at Joker Marchant Stadium','/api/v1/venues/2511','True'),
    (4309,'JetBlue Park','/api/v1/venues/4309','True'),
    (2518,'American Family Fields of Phoenix','/api/v1/venues/2518','True'),
    (2520,'Roger Dean Chevrolet Stadium','/api/v1/venues/2520','True'),
    (2392,'Minute Maid Park','/api/v1/venues/2392','True'),
    (3289,'Citi Field','/api/v1/venues/3289','True'),
    (2394,'Comerica Park','/api/v1/venues/2394','True'),
    (2523,'George M. Steinbrenner Field','/api/v1/venues/2523','True'),
    (2395,'Oracle Park','/api/v1/venues/2395','True'),
    (2526,'LECOM Park','/api/v1/venues/2526','True'),
    (3809,'Camelback Ranch','/api/v1/venues/3809','True'),
    (4705,'Truist Park','/api/v1/venues/4705','True'),
    (2530,'Peoria Stadium','/api/v1/venues/2530','True'),
    (2532,'Scottsdale Stadium','/api/v1/venues/2532','True'),
    (2534,'Charlotte Sports Park','/api/v1/venues/2534','True'),
    (2536,'TD Ballpark','/api/v1/venues/2536','True'),
    (3309,'Nationals Park','/api/v1/venues/3309','True'),
    (3312,'Target Field','/api/v1/venues/3312','True'),
    (3313,'Yankee Stadium','/api/v1/venues/3313','True'),
    (2680,'Petco Park','/api/v1/venues/2680','True'),
    (2681,'Citizens Bank Park','/api/v1/venues/2681','True'),
    (3834,'Goodyear Ballpark','/api/v1/venues/3834','True');

CREATE TABLE IF NOT EXISTS team (
    "springLeagueId" INT,
    "allStarStatus" TEXT,
    "id" INT,
    "name" TEXT,
    "link" TEXT,
    "season" INT,
    "venueId" INT,
    "springVenueId" INT,
    "teamCode" TEXT,
    "fileCode" TEXT,
    "abbreviation" TEXT,
    "teamName" TEXT,
    "locationName" TEXT,
    "firstYearOfPlay" INT,
    "leagueId" INT,
    "divisionId" INT,
    "sportId" INT,
    "shortName" TEXT,
    "franchiseName" TEXT,
    "clubName" TEXT,
    "active" TEXT,
    "venue" INT,
    "springVenue" INT
);
INSERT INTO team VALUES
    (114,'N',133,'Oakland Athletics','/api/v1/teams/133',2022,10,2507,'oak','oak','OAK','Athletics','Oakland',1901,103,200,1,'Oakland','Oakland','Athletics','True',NULL,NULL),
    (115,'N',134,'Pittsburgh Pirates','/api/v1/teams/134',2022,31,2526,'pit','pit','PIT','Pirates','Pittsburgh',1882,104,205,1,'Pittsburgh','Pittsburgh','Pirates','True',NULL,NULL),
    (114,'N',135,'San Diego Padres','/api/v1/teams/135',2022,2680,2530,'sdn','sd','SD','Padres','San Diego',1968,104,2,1,'San Diego','San Diego','Padres','True',NULL,NULL),
    (114,'N',136,'Seattle Mariners','/api/v1/teams/136',2022,680,2530,'sea','sea','SEA','Mariners','Seattle',1977,103,200,1,'Seattle','Seattle','Mariners','True',NULL,NULL),
    (114,'N',137,'San Francisco Giants','/api/v1/teams/137',2022,2395,2532,'sfn','sf','SF','Giants','San Francisco',1883,104,203,1,'San Francisco','San Francisco','Giants','True',NULL,NULL),
    (115,'N',138,'St. Louis Cardinals','/api/v1/teams/138',2022,NULL,NULL,'sln','stl','STL','Cardinals','St. Louis',1892,104,205,1,'St. Louis','St. Louis','Cardinals','True',2889,2520),
    (115,'N',139,'Tampa Bay Rays','/api/v1/teams/139',2022,12,2534,'tba','tb','TB','Rays','St. Petersburg',1996,103,201,1,'Tampa Bay','Tampa Bay','Rays','True',NULL,NULL),
    (114,'N',140,'Texas Rangers','/api/v1/teams/140',2022,5325,2603,'tex','tex','TEX','Rangers','Arlington',1961,103,200,1,'Texas','Texas','Rangers','True',NULL,NULL),
    (115,'N',141,'Toronto Blue Jays','/api/v1/teams/141',2022,14,2536,'tor','tor','TOR','Blue Jays','Toronto',1977,103,201,1,'Toronto','Toronto','Blue Jays','True',NULL,NULL),
    (115,'N',142,'Minnesota Twins','/api/v1/teams/142',2022,3312,2862,'min','min','MIN','Twins','Minneapolis',1901,103,202,1,'Minnesota','Minnesota','Twins','True',NULL,NULL),
    (115,'N',143,'Philadelphia Phillies','/api/v1/teams/143',2022,2681,2700,'phi','phi','PHI','Phillies','Philadelphia',1883,104,204,1,'Philadelphia','Philadelphia','Phillies','True',NULL,NULL),
    (115,'N',144,'Atlanta Braves','/api/v1/teams/144',2022,4705,5380,'atl','atl','ATL','Braves','Atlanta',1871,104,204,1,'Atlanta','Atlanta','Braves','True',NULL,NULL),
    (114,'N',145,'Chicago White Sox','/api/v1/teams/145',2022,4,3809,'cha','cws','CWS','White Sox','Chicago',1901,103,202,1,'Chi White Sox','Chicago','White Sox','True',NULL,NULL),
    (115,'N',146,'Miami Marlins','/api/v1/teams/146',2022,4169,2520,'mia','mia','MIA','Marlins','Miami',1991,104,204,1,'Miami','Miami','Marlins','True',NULL,NULL),
    (115,'N',147,'New York Yankees','/api/v1/teams/147',2022,3313,2523,'nya','nyy','NYY','Yankees','Bronx',1903,103,201,1,'NY Yankees','New York','Yankees','True',NULL,NULL),
    (114,'N',158,'Milwaukee Brewers','/api/v1/teams/158',2022,32,2518,'mil','mil','MIL','Brewers','Milwaukee',1968,104,205,1,'Milwaukee','Milwaukee','Brewers','True',NULL,NULL),
    (114,'N',108,'Los Angeles Angels','/api/v1/teams/108',2022,1,2500,'ana','ana','LAA','Angels','Anaheim',1961,103,200,1,'LA Angels','Los Angeles','Angels','True',NULL,NULL),
    (114,'N',109,'Arizona Diamondbacks','/api/v1/teams/109',2022,15,4249,'ari','ari','AZ','D-backs','Phoenix',1996,104,203,1,'Arizona','Arizona','Diamondbacks','True',NULL,NULL),
    (115,'N',110,'Baltimore Orioles','/api/v1/teams/110',2022,2,2508,'bal','bal','BAL','Orioles','Baltimore',1901,103,201,1,'Baltimore','Baltimore','Orioles','True',NULL,NULL),
    (115,'N',111,'Boston Red Sox','/api/v1/teams/111',2022,3,4309,'bos','bos','BOS','Red Sox','Boston',1901,103,201,1,'Boston','Boston','Red Sox','True',NULL,NULL),
    (114,'N',112,'Chicago Cubs','/api/v1/teams/112',2022,17,4629,'chn','chc','CHC','Cubs','Chicago',1874,104,205,1,'Chi Cubs','Chicago','Cubs','True',NULL,NULL),
    (114,'N',113,'Cincinnati Reds','/api/v1/teams/113',2022,2602,3834,'cin','cin','CIN','Reds','Cincinnati',1882,104,205,1,'Cincinnati','Cincinnati','Reds','True',NULL,NULL),
    (114,'N',114,'Cleveland Guardians','/api/v1/teams/114',2022,5,3834,'cle','cle','CLE','Guardians','Cleveland',1901,103,202,1,'Cleveland','Cleveland','Guardians','True',NULL,NULL),
    (114,'N',115,'Colorado Rockies','/api/v1/teams/115',2022,19,4249,'col','col','COL','Rockies','Denver',1992,104,203,1,'Colorado','Colorado','Rockies','True',NULL,NULL),
    (115,'N',116,'Detroit Tigers','/api/v1/teams/116',2022,2394,2511,'det','det','DET','Tigers','Detroit',1901,103,202,1,'Detroit','Detroit','Tigers','True',NULL,NULL),
    (115,'N',117,'Houston Astros','/api/v1/teams/117',2022,2392,5000,'hou','hou','HOU','Astros','Houston',1962,103,200,1,'Houston','Houston','Astros','True',NULL,NULL),
    (114,'N',118,'Kansas City Royals','/api/v1/teams/118',2022,7,2603,'kca','kc','KC','Royals','Kansas City',1968,103,202,1,'Kansas City','Kansas City','Royals','True',NULL,NULL),
    (114,'N',119,'Los Angeles Dodgers','/api/v1/teams/119',2022,22,3809,'lan','la','LAD','Dodgers','Los Angeles',1884,104,203,1,'LA Dodgers','Los Angeles','Dodgers','True',NULL,NULL),
    (115,'N',120,'Washington Nationals','/api/v1/teams/120',2022,3309,5000,'was','was','WSH','Nationals','Washington',1968,104,204,1,'Washington','Washington','Nationals','True',NULL,NULL),
    (115,'N',121,'New York Mets','/api/v1/teams/121',2022,3289,2856,'nyn','nym','NYM','Mets','Flushing',1962,104,204,1,'NY Mets','New York','Mets','True',NULL,NULL);

CREATE TABLE IF NOT EXISTS game (
    "gamePk" INT,
    "link" TEXT,
    "gameType" TEXT,
    "season" INT,
    "gameDate" TEXT,
    "officialDate" TIMESTAMP,
    "status_abstractGameState" TEXT,
    "status_codedGameState" TEXT,
    "status_detailedState" TEXT,
    "status_statusCode" TEXT,
    "status_startTimeTBD" TEXT,
    "status_abstractGameCode" TEXT,
    "teams_away_leagueRecord_wins" INT,
    "teams_away_leagueRecord_losses" INT,
    "teams_away_leagueRecord_pct" NUMERIC(3, 3),
    "teams_away_score" INT,
    "teams_away_teamId" INT,
    "teams_away_isWinner" TEXT,
    "teams_away_splitSquad" TEXT,
    "teams_away_seriesNumber" INT,
    "teams_home_leagueRecord_wins" INT,
    "teams_home_leagueRecord_losses" INT,
    "teams_home_leagueRecord_pct" NUMERIC(3, 3),
    "teams_home_score" INT,
    "teams_home_teamId" INT,
    "teams_home_isWinner" TEXT,
    "teams_home_splitSquad" TEXT,
    "teams_home_seriesNumber" INT,
    "venueId" INT,
    "content_link" TEXT,
    "isTie" TEXT,
    "gameNumber" INT,
    "publicFacing" TEXT,
    "doubleHeader" TEXT,
    "gamedayType" TEXT,
    "tiebreaker" TEXT,
    "calendarEventID" TEXT,
    "seasonDisplay" INT,
    "dayNight" TEXT,
    "scheduledInnings" INT,
    "reverseHomeAwayStatus" TEXT,
    "inningBreakLength" INT,
    "gamesInSeries" INT,
    "seriesGameNumber" INT,
    "seriesDescription" TEXT,
    "recordSource" TEXT,
    "ifNecessary" TEXT,
    "ifNecessaryDescription" TEXT
);