BEGIN;
CREATE TABLE IF NOT EXISTS "pk_fielding" (
	"playerID"	TEXT,
	"yearID"	NUMERIC,
	"stint"	NUMERIC,
	"teamID"	TEXT,
	"lgID"	TEXT,
	"POS"	TEXT,
	"G"	NUMERIC,
	"GS"	NUMERIC,
	"InnOuts"	NUMERIC,
	"PO"	NUMERIC,
	"A"	NUMERIC,
	"E"	NUMERIC,
	"DP"	NUMERIC,
	"PB"	NUMERIC,
	"WP"	NUMERIC,
	"SB"	NUMERIC,
	"CS"	NUMERIC,
	"ZR"	NUMERIC,
	PRIMARY KEY("playerID","yearID","stint","teamID","POS"),
	foreign key("playerID") references "people"("playerID"),
	foreign key("teamID") references "teams"("teamID")
);

INSERT INTO "pk_fielding" SELECT DISTINCT * FROM "fielding";
DROP TABLE "fielding";
ALTER TABLE "pk_fielding" RENAME TO "fielding";
COMMIT;
