resolve some foreign key issues

This commit is contained in:
Nick Griffey 2024-01-31 22:37:26 -06:00
parent 321fea8d5d
commit b8963f526c
3 changed files with 13 additions and 0 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,