Adjust for 2nf
This commit is contained in:
parent
0d00bddead
commit
7b04bfb776
|
@ -0,0 +1,15 @@
|
|||
begin;
|
||||
create table if not exists allstargames (
|
||||
"gameID" text,
|
||||
"yearID" numeric,
|
||||
"gameNum" numeric,
|
||||
primary key("gameID")
|
||||
);
|
||||
|
||||
insert into allstargames
|
||||
select distinct gameid, yearid, gamenum
|
||||
from allstarfull;
|
||||
|
||||
alter table allstarfull drop column "yearID";
|
||||
alter table allstarfull drop column "gameNum";
|
||||
commit;
|
|
@ -8,7 +8,7 @@ CREATE TABLE "pk_allstarfull" (
|
|||
"lgID" NUMERIC,
|
||||
"GP" NUMERIC,
|
||||
"startingPos" NUMERIC,
|
||||
primary key("playerID","yearID","gameNum","startingPos"),
|
||||
primary key("playerID","gameID","startingPos"),
|
||||
foreign key("playerID") references "people"("playerID")
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue