32 lines
596 B
MySQL
32 lines
596 B
MySQL
|
begin;
|
||
|
CREATE TABLE IF NOT EXISTS "pk_battingpost" (
|
||
|
"yearID" NUMERIC,
|
||
|
"round" NUMERIC,
|
||
|
"playerID" TEXT,
|
||
|
"teamID" TEXT,
|
||
|
"lgID" TEXT,
|
||
|
"G" NUMERIC,
|
||
|
"AB" NUMERIC,
|
||
|
"R" NUMERIC,
|
||
|
"H" NUMERIC,
|
||
|
"2B" NUMERIC,
|
||
|
"3B" NUMERIC,
|
||
|
"HR" NUMERIC,
|
||
|
"RBI" NUMERIC,
|
||
|
"SB" NUMERIC,
|
||
|
"CS" NUMERIC,
|
||
|
"BB" NUMERIC,
|
||
|
"SO" NUMERIC,
|
||
|
"IBB" NUMERIC,
|
||
|
"HBP" NUMERIC,
|
||
|
"SH" NUMERIC,
|
||
|
"SF" NUMERIC,
|
||
|
"GIDP" NUMERIC,
|
||
|
PRIMARY KEY("yearID","playerID","round")
|
||
|
);
|
||
|
|
||
|
INSERT INTO "pk_battingpost" SELECT DISTINCT * FROM "battingpost";
|
||
|
DROP TABLE "battingpost";
|
||
|
ALTER TABLE "pk_battingpost" RENAME TO "battingpost";
|
||
|
commit;
|