add leagues table
This commit is contained in:
parent
45b6b1a79a
commit
8c475d36e5
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/teamseasons.sql sql/seasons.sql sql/parks.sql sql/collegeplaying.sql sql/schools.sql sql/people.sql sql/salaries.sql sql/batting.sql sql/pitching.sql sql/fielding.sql sql/appearances.sql sql/homegames.sql sql/seriespost.sql sql/fieldingofsplit.sql sql/teams.sql
|
||||
baseball-transformed.db: baseball-raw.db sql/awards.sql sql/franchises.sql sql/teamseasons.sql sql/seasons.sql sql/parks.sql sql/collegeplaying.sql sql/schools.sql sql/people.sql sql/salaries.sql sql/batting.sql sql/pitching.sql sql/fielding.sql sql/appearances.sql sql/homegames.sql sql/seriespost.sql sql/fieldingofsplit.sql sql/teams.sql sql/leagues.sql
|
||||
rm -f baseball-transformed.db
|
||||
cp baseball-raw.db baseball-transformed.db
|
||||
cat sql/franchises.sql | sqlite3 baseball-transformed.db
|
||||
|
@ -29,6 +29,7 @@ baseball-transformed.db: baseball-raw.db sql/awards.sql sql/franchises.sql sql/t
|
|||
cat sql/seriespost.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/fieldingofsplit.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/teams.sql | sqlite3 baseball-transformed.db
|
||||
cat sql/leagues.sql | sqlite3 baseball-transformed.db
|
||||
|
||||
baseball-raw.db:
|
||||
rm -f baseball-raw.db
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
begin;
|
||||
create table if not exists "leagues" (
|
||||
"ID" text
|
||||
);
|
||||
|
||||
insert into leagues values
|
||||
("NA"),
|
||||
("NL"),
|
||||
("AA"),
|
||||
("UA"),
|
||||
("PL"),
|
||||
("AL"),
|
||||
("FL");
|
||||
commit;
|
|
@ -357,4 +357,11 @@ create table if not exists teams (
|
|||
);
|
||||
|
||||
insert into teams select distinct * from "transformed"."teams";
|
||||
|
||||
create table if not exists "leagues" (
|
||||
"ID" text,
|
||||
primary key("ID")
|
||||
);
|
||||
|
||||
insert into leagues select distinct * from "transformed"."leagues";
|
||||
COMMIT;
|
||||
|
|
Loading…
Reference in New Issue