lahmanlite/sql/keys/pitchingpost.sql

41 lines
787 B
MySQL
Raw Normal View History

2024-01-26 00:48:11 +00:00
BEGIN;
CREATE TABLE IF NOT EXISTS "pk_pitchingpost" (
"playerID" TEXT,
"yearID" NUMERIC,
"round" NUMERIC,
"teamID" TEXT,
"lgID" TEXT,
"W" NUMERIC,
"L" NUMERIC,
"G" NUMERIC,
"GS" NUMERIC,
"CG" NUMERIC,
"SHO" NUMERIC,
"SV" NUMERIC,
"IPouts" NUMERIC,
"H" NUMERIC,
"ER" NUMERIC,
"HR" NUMERIC,
"BB" NUMERIC,
"SO" NUMERIC,
"BAOpp" NUMERIC,
"ERA" NUMERIC,
"IBB" NUMERIC,
"WP" NUMERIC,
"HBP" NUMERIC,
"BK" NUMERIC,
"BFP" NUMERIC,
"GF" NUMERIC,
"R" NUMERIC,
"SH" NUMERIC,
"SF" NUMERIC,
"GIDP" NUMERIC,
2024-01-26 01:49:08 +00:00
PRIMARY KEY("playerID","yearID","round"),
foreign key("playerID") references "people"("playerID")
2024-01-26 00:48:11 +00:00
);
INSERT INTO "pk_pitchingpost" SELECT DISTINCT * FROM "pitchingpost";
DROP TABLE "pitchingpost";
ALTER TABLE "pk_pitchingpost" RENAME TO "pitchingpost";
COMMIT;