From 02418b5f92b62528c5afac171213f619c6e4e2b5 Mon Sep 17 00:00:00 2001 From: Nick Griffey Date: Sat, 27 Jan 2024 12:58:48 -0600 Subject: [PATCH] normalize halloffame --- sql/2nf/halloffame.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sql/2nf/halloffame.sql diff --git a/sql/2nf/halloffame.sql b/sql/2nf/halloffame.sql new file mode 100644 index 0000000..82c9715 --- /dev/null +++ b/sql/2nf/halloffame.sql @@ -0,0 +1,18 @@ +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;