lahmanlite/sql/franchises.sql

24 lines
442 B
MySQL
Raw Normal View History

pragma foreign_keys = 0;
2024-01-28 00:05:45 +00:00
begin;
2024-01-31 06:09:39 +00:00
attach database 'baseball-raw.db' as 'raw';
create temp table franchises as
select * from "raw".teamsfranchises;
2024-02-02 02:48:12 +00:00
update franchises
set active = 'N'
where active = 'NA';
2024-01-31 06:09:39 +00:00
CREATE TABLE IF NOT EXISTS main."franchises" (
"ID" TEXT,
"name" TEXT,
2024-02-02 02:48:12 +00:00
"active" TEXT check ("active" in ('Y','N')),
2024-01-31 06:09:39 +00:00
"NAassoc" TEXT,
PRIMARY KEY("ID")
);
insert into main.franchises
select distinct * from temp."franchises";
2024-01-28 00:05:45 +00:00
commit;