lahmanlite/sql/teamcodes.sql

19 lines
353 B
MySQL
Raw Normal View History

2024-01-28 03:19:48 +00:00
begin;
attach database 'baseball-raw.db' as 'raw';
create table if not exists teamcodes (
2024-01-28 03:29:07 +00:00
"ID" text,
2024-01-28 03:19:48 +00:00
"franchise" text
);
insert into teamcodes
select distinct teamid, franchid from "raw"."teams";
update teamcodes
2024-01-28 03:29:07 +00:00
set ID = 'WS9'
where ID = 'WAS' and franchise = 'WAS';
2024-01-28 03:19:48 +00:00
update teamcodes
2024-01-28 03:29:07 +00:00
set ID = 'PHP'
where ID = 'PH4' and franchise = 'PHQ';
2024-01-28 03:19:48 +00:00
commit;