drop table course;
create table course(
  course_id char(5) not null,
  course char(10) not null,
  primary key (course_id)
);
  
drop table score;
create table score(
  course_id char(5) not null,
  person_id char(5) not null,
  class_name char(10) not null,
  score numeric(5,0),
  score_flag char(10),
  primary key(course_id,person_id,class_name)
);

drop table student;
create table student(
  person_id char(5) not null,
  class_name char(10) not null,
  sex char(1) not null,
  person_name char(8) not null,
  primary key (person_id)
);

ALTER TABLE score
        ADD CONSTRAINT course_id
        FOREIGN KEY (course_id)
        REFERENCES course ;
        
ALTER TABLE score
        ADD CONSTRAINT person_id
        FOREIGN KEY (person_id)
        REFERENCES student;
        
        