lahmanlite/sql/2nf/halloffame.sql

19 lines
444 B
PL/PgSQL

begin;
create table if not exists "halloffamereqs" (
"yearID" numeric,
"votedBy" text,
"ballots" numeric,
"needed" numeric,
"needed_note" text,
primary key("yearID","votedBy")
);
insert into halloffamereqs
select distinct yearid, votedby, ballots, needed, "needed_note"
from halloffame;
alter table halloffame drop column "ballots";
alter table halloffame drop column "needed";
alter table halloffame drop column "needed_note";
commit;