set echo on;

drop table student;
create table student (
mit_id_number            char(9)   not null,
name                     char(30)  not null,
gender                   char(1)   not null,
date_of_birth            date      not null,
citizen_code             char(1)   not null,
foreign_visa_code        char(1)   not null,
term_address_line1       char(30)  not null,
term_address_line2       char(30)  not null,
term_address_city        char(18)  not null,
term_address_state       char(12)  not null,
term_geogr_code          char(3)   not null,
term_zip_code            char(5)   not null,
home_address_line1       char(30)  not null,
home_address_line2       char(30)  not null,
home_address_city        char(18)  not null,
home_address_state       char(12)  not null,
home_geogr_code          char(3)   not null,
home_zip_code            char(5)   not null,
dorm_line                char(6)   not null,
home_phone               char(10)  not null,
other_phone              char(10)  not null,
mit_office               char(16)  not null,
mit_extension            char(6)   not null,
student_course1          char(3)   not null,
student_course2          char(3)   not null,
student_course3          char(3)   not null,
next_term_course         char(3)   not null,
student_year1            number(2) not null,
student_year2            number(2) not null,
student_year3            number(2) not null,
next_term_year           number(2) not null,
year_term_entry          char(3)   not null,
exp_completion_date      date   not null,
audit_strip              char(240) not null
);


drop table course;
create table course (
course_num       char(2)   not null,
year             char(4)   not null,
title            char(32)  not null,
school           char(32)  not null
);


drop table subject;
create table subject (
subject_num      char(8)   not null,
year             char(4)   not null,
title            char(32)  not null
);


drop table term_summary;
create table term_summary (
mit_id           char(11)  not null,
course_num       char(2)   not null,
term             char(4)   not null,
total_units      number(6) not null,
ratings_term     number(6) not null,
ratings_cum      number(6) not null
);


drop table grade_history;
create table grade_history (
mit_id           char(11)  not null,
subject_num      char(8)   not null,
units            number(3) not null,
grade            char(1)   not null,
audit_codes      char(20)  not null
);


commit;
