pragma foreign_keys = 0;

begin;
attach database 'baseball-raw.db' as 'raw';
CREATE TABLE IF NOT EXISTS "fieldingof" (
	"player"	TEXT,
	"year"	NUMERIC,
	"stint"	NUMERIC,
	"Glf"	NUMERIC,
	"Gcf"	NUMERIC,
	"Grf"	NUMERIC,
	PRIMARY KEY("player","year","stint"),
	foreign key("year","player","stint") references "playerstints"("year","player","stint")
);

insert into fieldingof select distinct * from "raw"."fieldingof";
commit;
