ALTER TABLE INSTRUCTOR
 ADD CONSTRAINT INST_PK PRIMARY KEY 
  (INSTRUCTOR_ID)
;

ALTER TABLE GRADE
 ADD CONSTRAINT GR_PK PRIMARY KEY 
  (STUDENT_ID
  ,SECTION_ID
  ,GRADE_TYPE_CODE
  ,GRADE_CODE_OCCURRENCE)
;

ALTER TABLE GRADE_TYPE
 ADD CONSTRAINT GRTYP_PK PRIMARY KEY 
  (GRADE_TYPE_CODE)
;

ALTER TABLE GRADE_CONVERSION
 ADD CONSTRAINT GRCON_PK PRIMARY KEY 
  (LETTER_GRADE)
;

ALTER TABLE GRADE_TYPE_WEIGHT
 ADD CONSTRAINT GRTW_PK PRIMARY KEY 
  (SECTION_ID
  ,GRADE_TYPE_CODE)
;

ALTER TABLE SECTION
 ADD CONSTRAINT SECT_PK PRIMARY KEY 
  (SECTION_ID)
;

ALTER TABLE COURSE
 ADD CONSTRAINT CRSE_PK PRIMARY KEY 
  (COURSE_NO)
;

ALTER TABLE ENROLLMENT
 ADD CONSTRAINT ENR_PK PRIMARY KEY 
  (STUDENT_ID
  ,SECTION_ID)
;

ALTER TABLE STUDENT
 ADD CONSTRAINT STU_PK PRIMARY KEY 
  (STUDENT_ID)
;

ALTER TABLE ZIPCODE
 ADD CONSTRAINT ZIP_PK PRIMARY KEY 
  (ZIP)
;

ALTER TABLE SECTION 
 ADD ( CONSTRAINT SECT_SECT2_UK UNIQUE 
  (SECTION_NO
  ,COURSE_NO))
;

ALTER TABLE INSTRUCTOR ADD CONSTRAINT
 INST_ZIP_FK FOREIGN KEY 
  (ZIP) REFERENCES ZIPCODE
  (ZIP)
;

ALTER TABLE GRADE ADD CONSTRAINT
 GR_ENR_FK FOREIGN KEY 
  (STUDENT_ID
  ,SECTION_ID) REFERENCES ENROLLMENT
  (STUDENT_ID
  ,SECTION_ID) ADD CONSTRAINT
 GR_GRTW_FK FOREIGN KEY 
  (SECTION_ID
  ,GRADE_TYPE_CODE) REFERENCES GRADE_TYPE_WEIGHT
  (SECTION_ID
  ,GRADE_TYPE_CODE)
;

ALTER TABLE GRADE_TYPE_WEIGHT ADD CONSTRAINT
 GRTW_GRTYP_FK FOREIGN KEY 
  (GRADE_TYPE_CODE) REFERENCES GRADE_TYPE
  (GRADE_TYPE_CODE) ADD CONSTRAINT
 GRTW_SECT_FK FOREIGN KEY 
  (SECTION_ID) REFERENCES SECTION
  (SECTION_ID)
;

ALTER TABLE SECTION ADD CONSTRAINT
 SECT_INST_FK FOREIGN KEY 
  (INSTRUCTOR_ID) REFERENCES INSTRUCTOR
  (INSTRUCTOR_ID) ADD CONSTRAINT
 SECT_CRSE_FK FOREIGN KEY 
  (COURSE_NO) REFERENCES COURSE
  (COURSE_NO)
;

ALTER TABLE COURSE ADD CONSTRAINT
 CRSE_CRSE_FK FOREIGN KEY 
  (PREREQUISITE) REFERENCES COURSE
  (COURSE_NO)
;

ALTER TABLE ENROLLMENT ADD CONSTRAINT
 ENR_STU_FK FOREIGN KEY 
  (STUDENT_ID) REFERENCES STUDENT
  (STUDENT_ID) ADD CONSTRAINT
 ENR_SECT_FK FOREIGN KEY 
  (SECTION_ID) REFERENCES SECTION
  (SECTION_ID)
;

ALTER TABLE STUDENT ADD CONSTRAINT
 STU_ZIP_FK FOREIGN KEY 
  (ZIP) REFERENCES ZIPCODE
  (ZIP)
;