lahmanlite/sql/teams.sql

19 lines
337 B
MySQL
Raw Normal View History

2024-01-28 03:19:48 +00:00
begin;
attach database 'baseball-raw.db' as 'raw';
2024-01-28 03:41:23 +00:00
create table if not exists teams (
2024-01-28 03:29:07 +00:00
"ID" text,
2024-01-28 03:19:48 +00:00
"franchise" text
);
2024-01-28 03:41:23 +00:00
insert into teams
2024-01-28 03:19:48 +00:00
select distinct teamid, franchid from "raw"."teams";
2024-01-28 03:41:23 +00:00
update teams
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
2024-01-28 03:41:23 +00:00
update teams
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;