lahmanlite/sql/keys/fieldingpost.sql

28 lines
589 B
MySQL
Raw Normal View History

2024-01-26 00:48:11 +00:00
BEGIN;
CREATE TABLE IF NOT EXISTS "pk_fieldingpost" (
"playerID" TEXT,
"yearID" NUMERIC,
"teamID" TEXT,
"lgID" TEXT,
"round" NUMERIC,
"POS" TEXT,
"G" NUMERIC,
"GS" NUMERIC,
"InnOuts" NUMERIC,
"PO" NUMERIC,
"A" NUMERIC,
"E" NUMERIC,
"DP" NUMERIC,
"TP" NUMERIC,
"PB" NUMERIC,
"SB" NUMERIC,
"CS" NUMERIC,
2024-01-26 01:49:08 +00:00
PRIMARY KEY("playerID","yearID","round","POS"),
foreign key("playerID") references "people"("playerID")
2024-01-26 00:48:11 +00:00
);
INSERT INTO "pk_fieldingpost" SELECT DISTINCT * FROM "fieldingpost";
DROP TABLE "fieldingpost";
ALTER TABLE "pk_fieldingpost" RENAME TO "fieldingpost";
COMMIT;