pragma foreign_keys = 0; begin; attach database 'baseball-raw.db' as 'raw'; CREATE TABLE IF NOT EXISTS "awardssharemanagers" ( "award" TEXT, "year" NUMERIC, "league" TEXT, "manager" TEXT, "pointsWon" NUMERIC, "pointsMax" NUMERIC, "votesFirst" NUMERIC, PRIMARY KEY("manager","award","year","league"), foreign key("manager") references "people"("ID"), foreign key("award","year","league") references "yearlyawards"("award","year","league") ); insert into awardssharemanagers select distinct * from "raw"."awardssharemanagers"; commit;