lahmanlite/sql/awardssharemanagers.sql

19 lines
520 B
MySQL
Raw Normal View History

2024-01-31 06:09:39 +00:00
begin;
attach database 'baseball-raw.db' as 'raw';
CREATE TABLE IF NOT EXISTS "awardssharemanagers" (
"award" TEXT,
"year" NUMERIC,
"league" TEXT,
"manager" TEXT,
"pointsWon" NUMERIC,
"pointsMax" NUMERIC,
"votesFirst" NUMERIC,
PRIMARY KEY("manager","award","year","league"),
foreign key("manager") references "people"("ID"),
foreign key("award","year","league") references "yearlyawards"("award","year","league")
);
insert into awardssharemanagers select distinct * from "raw"."awardssharemanagers";
commit;