20 lines
390 B
PL/PgSQL
20 lines
390 B
PL/PgSQL
begin;
|
|
attach database 'baseball-raw.db' as 'raw';
|
|
|
|
create table if not exists appearancespost (
|
|
"year" numeric,
|
|
"player" text,
|
|
"team" text
|
|
);
|
|
|
|
insert into appearancespost
|
|
select distinct yearID, playerID, teamID
|
|
from 'raw'.battingpost
|
|
union
|
|
select distinct yearID, playerID, teamID
|
|
from 'raw'.pitchingpost
|
|
union
|
|
select distinct yearID, playerID, teamID
|
|
from 'raw'.fieldingpost;
|
|
commit;
|