lahmanlite/sql/keys/allstarfull.sql

19 lines
468 B
MySQL
Raw Normal View History

2024-01-25 05:44:50 +00:00
BEGIN;
CREATE TABLE "pk_allstarfull" (
"playerID" NUMERIC,
"yearID" NUMERIC,
"gameNum" NUMERIC,
"gameID" NUMERIC,
"teamID" NUMERIC,
"lgID" NUMERIC,
"GP" NUMERIC,
"startingPos" NUMERIC,
primary key("playerID","yearID","gameNum","startingPos"),
foreign key("playerID") references "people"("playerID")
2024-01-25 05:44:50 +00:00
);
INSERT INTO "pk_allstarfull" SELECT DISTINCT * FROM "allstarfull";
DROP TABLE "allstarfull";
ALTER TABLE "pk_allstarfull" RENAME TO "allstarfull";
COMMIT;