lahmanlite/sql/2nf/teamshalfdivision.sql

16 lines
322 B
PL/PgSQL

begin;
create table if not exists "teamshalfdivisions" (
"yearID" numeric,
"teamID" text,
"divID" text,
primary key("yearID","teamID")
);
insert into teamshalfdivisions
select distinct yearid, teamid, divid
from teamshalf;
alter table teamshalf drop column "lgID";
alter table teamshalf drop column "divID";
commit;