lahmanlite/sql/parks.sql

29 lines
649 B
MySQL
Raw Normal View History

pragma foreign_keys = 0;
2024-01-26 03:43:23 +00:00
begin;
2024-01-31 06:09:39 +00:00
attach database 'baseball-raw.db' as 'raw';
create temp table parks as
select * from "raw".parks;
2024-01-26 17:47:18 +00:00
alter table parks drop column "park.alias";
2024-01-28 01:05:31 +00:00
-- insert some missing parks
insert into parks values
('ARL03', 'Globe Life Field', 'Arlington', 'TX', 'US'),
('BUF05', 'Sahlen Field', 'Buffalo', 'NY', 'US'),
('DUN01', 'TD Ballpark', 'Dunedin', 'FL', 'US'),
('DYE01', 'Field of Dreams', 'Dyersville', 'IA', 'US');
2024-01-31 06:09:39 +00:00
CREATE TABLE IF NOT EXISTS main."parks" (
"ID" TEXT,
"name" TEXT,
"city" TEXT,
"state" TEXT,
"country" TEXT,
PRIMARY KEY("ID")
);
insert into main.parks select distinct * from temp."parks";
2024-01-26 03:43:23 +00:00
commit;