begin;
attach database 'baseball-raw.db' as 'raw';
create temp table if not exists "seasons" (
	"year"	text
);

insert into seasons select distinct yearID from "raw".appearances;

create table if not exists main."seasons" (
	"year"	numeric,
	primary key("year")
);

insert into main.seasons
select distinct * from temp."seasons";
commit;
