From b8963f526c62bc0f0c894552691448959f890fd6 Mon Sep 17 00:00:00 2001 From: Nick Griffey Date: Wed, 31 Jan 2024 22:37:26 -0600 Subject: [PATCH] resolve some foreign key issues --- sql/appearances.sql | 5 +++++ sql/batting.sql | 4 ++++ sql/playerstints.sql | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/sql/appearances.sql b/sql/appearances.sql index ef91f92..1ba6593 100644 --- a/sql/appearances.sql +++ b/sql/appearances.sql @@ -14,6 +14,11 @@ update appearances set teamid = 'PHP' where teamid = 'PH4' and yearid between 1890 and 1891; +-- got this missing data from bbref +insert into appearances values + (1896,'BRO','dailyco01',1,null,1,null,0,1,0,0,0,0,0,0,0,0,0,null,null), + (1875,'WS6','thompfr01',11,null,11,null,0,11,0,0,0,0,0,0,1,1,0,null,null); + CREATE TABLE IF NOT EXISTS "appearances" ( "year" NUMERIC, "team" TEXT, diff --git a/sql/batting.sql b/sql/batting.sql index dbef005..2aacec0 100644 --- a/sql/batting.sql +++ b/sql/batting.sql @@ -7,6 +7,10 @@ select * from "raw".batting; alter table batting drop column "lgID"; alter table batting drop column "teamID"; +-- bbref doesn't say this guy played in 1911 +delete from batting +where playerid = 'smithbu01' and yearid = 1911; + CREATE TABLE IF NOT EXISTS main."batting" ( "player" TEXT, "year" NUMERIC, diff --git a/sql/playerstints.sql b/sql/playerstints.sql index ae09611..aa87f84 100644 --- a/sql/playerstints.sql +++ b/sql/playerstints.sql @@ -26,6 +26,10 @@ update playerstints set team = 'PHP' where team = 'PH4' and year between 1890 and 1891; +-- bbref doesn't say this guy played in 1911 +delete from playerstints +where player = 'smithbu01' and year = 1911; + create table if not exists main."playerstints" ( "player" text, "year" numeric,