Initial commit
This commit is contained in:
12
sql/corrections/allstarfull.sql
Normal file
12
sql/corrections/allstarfull.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
begin;
|
||||
update allstarfull
|
||||
set gamenum = 1
|
||||
where gameid = 'ALS196207100';
|
||||
|
||||
update allstarfull
|
||||
set gamenum = 2
|
||||
where gameid = 'NLS196207300';
|
||||
|
||||
delete from allstarfull
|
||||
where playerid = 'freesda01' and yearid = 2012 and lgid = 'AL';
|
||||
commit;
|
||||
17
sql/keys/allstarfull.sql
Normal file
17
sql/keys/allstarfull.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
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")
|
||||
);
|
||||
|
||||
INSERT INTO "pk_allstarfull" SELECT DISTINCT * FROM "allstarfull";
|
||||
DROP TABLE "allstarfull";
|
||||
ALTER TABLE "pk_allstarfull" RENAME TO "allstarfull";
|
||||
COMMIT;
|
||||
33
sql/keys/people.sql
Normal file
33
sql/keys/people.sql
Normal file
@@ -0,0 +1,33 @@
|
||||
BEGIN;
|
||||
CREATE TABLE "pk_people" (
|
||||
"playerID" NUMERIC,
|
||||
"birthYear" NUMERIC,
|
||||
"birthMonth" NUMERIC,
|
||||
"birthDay" NUMERIC,
|
||||
"birthCountry" NUMERIC,
|
||||
"birthState" NUMERIC,
|
||||
"birthCity" NUMERIC,
|
||||
"deathYear" NUMERIC,
|
||||
"deathMonth" NUMERIC,
|
||||
"deathDay" NUMERIC,
|
||||
"deathCountry" NUMERIC,
|
||||
"deathState" NUMERIC,
|
||||
"deathCity" NUMERIC,
|
||||
"nameFirst" NUMERIC,
|
||||
"nameLast" NUMERIC,
|
||||
"nameGiven" NUMERIC,
|
||||
"weight" NUMERIC,
|
||||
"height" NUMERIC,
|
||||
"bats" NUMERIC,
|
||||
"throws" NUMERIC,
|
||||
"debut" NUMERIC,
|
||||
"finalGame" NUMERIC,
|
||||
"retroID" NUMERIC,
|
||||
"bbrefID" NUMERIC,
|
||||
primary key("playerID")
|
||||
);
|
||||
|
||||
INSERT INTO "pk_people" SELECT DISTINCT * FROM "people";
|
||||
DROP TABLE "people";
|
||||
ALTER TABLE "pk_people" RENAME TO "people";
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user