add collegeplaying
This commit is contained in:
parent
9c955df284
commit
7ed54099e4
3
Makefile
3
Makefile
|
@ -9,7 +9,7 @@ baseball.db: baseball-transformed.db sql/load.sql
|
|||
cat sql/load.sql | sqlite3 baseball.db
|
||||
sqlite3 baseball.db "VACUUM"
|
||||
|
||||
baseball-transformed.db: baseball-raw.db sql/awards.sql sql/franchises.sql sql/franchiseseasons.sql sql/seasons.sql sql/parks.sql
|
||||
baseball-transformed.db: baseball-raw.db sql/awards.sql sql/franchises.sql sql/franchiseseasons.sql sql/seasons.sql sql/parks.sql sql/collegeplaying.sql
|
||||
rm -f baseball-transformed.db
|
||||
cp baseball-raw.db baseball-transformed.db
|
||||
cat sql/franchises.sql | sqlite3 baseball-transformed.db
|
||||
|
@ -17,6 +17,7 @@ baseball-transformed.db: baseball-raw.db sql/awards.sql sql/franchises.sql sql/f
|
|||
cat sql/awards.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/seasons.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/parks.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/collegeplaying.sql | sqlite3 baseball-transformed.db
|
||||
|
||||
baseball-raw.db:
|
||||
rm -f baseball-raw.db
|
||||
|
|
11
sql/load.sql
11
sql/load.sql
|
@ -134,4 +134,15 @@ CREATE TABLE IF NOT EXISTS "parkaliases" (
|
|||
);
|
||||
|
||||
insert into "parkaliases" select distinct * from "transformed"."parkaliases";
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "collegeplaying" (
|
||||
"playerID" TEXT,
|
||||
"schoolID" TEXT,
|
||||
"yearID" NUMERIC,
|
||||
PRIMARY KEY("playerID","yearID","schoolID"),
|
||||
foreign key("playerID") references "people"("playerID"),
|
||||
foreign key("schoolID") references "schools"("schoolID")
|
||||
);
|
||||
|
||||
insert into collegeplaying select distinct * from "transformed"."collegeplaying";
|
||||
COMMIT;
|
||||
|
|
Loading…
Reference in New Issue