drop table game cascade constraints;
create table game(
  GameDate     date,
  location     varchar2(30),
  time         number(4),
  attendance   number,
  official1    varchar2(30),
  official2    varchar2(30),
  official3    varchar2(30),
  HomeTeam     varchar2(25),
  VisitTeam    varchar2(25),
  HTscore      number(4),
  VTscore      number(4), 
  HTscoreQ1    number(3),
  HTscoreQ2    number(3), 
  HTscoreQ3    number(3), 
  HTscoreQ4    number(3),  
  VTscoreQ1    number(3), 
  VTscoreQ2    number(3), 
  VTscoreQ3    number(3), 
  VTscoreQ4    number(3),    
  HTscoreOT1   number(3),
  HTscoreOT2   number(3), 
  VTscoreOT1   number(3),
  VTscoreOT2   number(3),  
  primary key (GameDate, HomeTeam, VisitTeam) 
 );

drop table STATS cascade constraints;
create table STATS (
  Pname     varchar2(30),
  Tname     varchar2(30),
  GameDate  date,
  HomeTeam  varchar2(25),
  VisitTeam varchar2(25),
  MIN       number(3),
  POS       varchar2(2),
  FGM       number(3),                
  FGA       number(3),
  ThreePM   number(3),
  ThreePA   number(3),
  FTM       number(3),
  FTA       number(3),
  OFF       number(3),
  DEF       number(3),
  TOT       number(3),
  AST       number(3),
  PF        number(3),
  ST        number(3),
  TO_1      number(3),
  BS        number(3),
  PTS       number(3),
  primary key (Pname,GameDate,HomeTeam, VisitTeam),
  foreign key (GameDate,HomeTeam, VisitTeam) references game);
