2024-01-31 22:43:23 -06:00
|
|
|
pragma foreign_keys = 0;
|
|
|
|
|
|
2024-01-27 18:05:45 -06:00
|
|
|
begin;
|
2024-05-04 22:11:20 -05:00
|
|
|
attach database 'lahman-raw.db' as 'raw';
|
2024-01-31 00:09:39 -06:00
|
|
|
create temp table if not exists "seasons" (
|
2024-01-27 18:05:45 -06:00
|
|
|
"year" text
|
|
|
|
|
);
|
2024-01-27 19:39:35 -06:00
|
|
|
|
2024-01-31 00:09:39 -06:00
|
|
|
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";
|
2024-01-27 18:05:45 -06:00
|
|
|
commit;
|