change columns

This commit is contained in:
filifa 2024-05-04 20:59:32 -05:00
parent cffc0d50a8
commit a067ff62b2
1 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,9 @@ select * from "raw".batting;
alter table batting drop column "lgID"; alter table batting drop column "lgID";
alter table batting drop column "teamID"; alter table batting drop column "teamID";
alter table batting drop column "G";
alter table batting drop column "G_batting";
-- bbref doesn't say this guy played in 1911 -- bbref doesn't say this guy played in 1911
delete from batting delete from batting
@ -29,7 +32,6 @@ CREATE TABLE IF NOT EXISTS main."batting" (
"player" TEXT, "player" TEXT,
"year" NUMERIC, "year" NUMERIC,
"stint" NUMERIC, "stint" NUMERIC,
"G" NUMERIC,
"AB" NUMERIC, "AB" NUMERIC,
"R" NUMERIC, "R" NUMERIC,
"H" NUMERIC check (H <= AB), "H" NUMERIC check (H <= AB),
@ -46,6 +48,7 @@ CREATE TABLE IF NOT EXISTS main."batting" (
"SH" NUMERIC, "SH" NUMERIC,
"SF" NUMERIC, "SF" NUMERIC,
"GIDP" NUMERIC check (GIDP <= AB), "GIDP" NUMERIC check (GIDP <= AB),
"G_old" NUMERIC check (GIDP <= AB),
PRIMARY KEY("player","year","stint"), PRIMARY KEY("player","year","stint"),
foreign key("year","player","stint") references "playerstints"("year","player","stint") foreign key("year","player","stint") references "playerstints"("year","player","stint")
); );