lahmanlite/sql/keys/collegeplaying.sql

15 lines
447 B
MySQL
Raw Normal View History

2024-01-26 00:48:11 +00:00
BEGIN;
CREATE TABLE IF NOT EXISTS "pk_collegeplaying" (
"playerID" TEXT,
"schoolID" TEXT,
"yearID" NUMERIC,
2024-01-26 01:49:08 +00:00
PRIMARY KEY("playerID","yearID","schoolID"),
foreign key("playerID") references "people"("playerID"),
foreign key("schoolID") references "schools"("schoolID")
2024-01-26 00:48:11 +00:00
);
INSERT INTO "pk_collegeplaying" SELECT DISTINCT * FROM "collegeplaying";
DROP TABLE "collegeplaying";
ALTER TABLE "pk_collegeplaying" RENAME TO "collegeplaying";
COMMIT;