/*==============================================================*/ /* Database name: VIRTUALSCHOOLOFFICE */ /* DBMS name: MySQL 3.23 */ /* Created on: 27/02/2003 20:02:33 */ /*==============================================================*/ drop table if exists MODULE_ASSIGNMENT; drop table if exists STUDENT_ASSIGNMENT; drop table if exists ASSIGNMENT; drop table if exists COURSE_MODULE; drop table if exists MODULE_TUTOR; drop table if exists TUTOR; drop table if exists STUDENT; drop table if exists MODULE; drop table if exists COURSE; /*==============================================================*/ /* Table : COURSE */ /*==============================================================*/ create table if not exists COURSE ( COURSE_ID int not null, COURSE_NAME varchar(255) not null, primary key (COURSE_ID) ); /*==============================================================*/ /* Table : MODULE */ /*==============================================================*/ create table if not exists MODULE ( MODULE_ID int not null, MODULE_NAME varchar(255) not null, primary key (MODULE_ID) ); /*==============================================================*/ /* Table : STUDENT */ /*==============================================================*/ create table if not exists STUDENT ( STUDENT_ID int not null, FIRST_NAME varchar(255) not null, LAST_NAME varchar(255) not null, USERNAME varchar(255) not null, PASSWORD varchar(255) not null, EMAIL_ADDRESS varchar(255) not null, MOBILE_NUMBER varchar(20) not null, TUTOR_GROUP varchar(255) not null, COURSE_YEAR int not null, COURSE_ID int not null, primary key (STUDENT_ID) ); /*==============================================================*/ /* Table : TUTOR */ /*==============================================================*/ create table if not exists TUTOR ( TUTOR_ID int not null, FIRST_NAME varchar(255) not null, LAST_NAME varchar(255) not null, USERNAME varchar(255) not null, EMAIL_ADDRESS varchar(255) not null, primary key (TUTOR_ID) ); /*==============================================================*/ /* Table : MODULE_TUTOR */ /*==============================================================*/ create table if not exists MODULE_TUTOR ( MODULE_ID int not null, TUTOR_ID int not null, primary key (MODULE_ID, TUTOR_ID) ); /*==============================================================*/ /* Table : COURSE_MODULE */ /*==============================================================*/ create table if not exists COURSE_MODULE ( MODULE_ID int not null, COURSE_ID int not null, COURSE_YEAR int not null, primary key (MODULE_ID, COURSE_ID) ); /*==============================================================*/ /* Table : ASSIGNMENT */ /*==============================================================*/ create table if not exists ASSIGNMENT ( ASSIGNMENT_ID int not null, MARKED_BY int not null, ASSIGNMENT_NAME varchar(255), DEADLINE datetime, primary key (ASSIGNMENT_ID) ); /*==============================================================*/ /* Table : STUDENT_ASSIGNMENT */ /*==============================================================*/ create table if not exists STUDENT_ASSIGNMENT ( STUDENT_ID int not null, ASSIGNMENT_ID int not null, MARK float, TUTOR_COMMENT text, HASH_VALUE varchar(128) not null, PIN_NUMBER varchar(128) not null, SUBMIT_DATETIME datetime not null, ASSIGNMENT_LOCATION varchar(255) not null, IS_SUBMITTED tinyint(1) not null, RECEIPT varchar(255), primary key (STUDENT_ID, ASSIGNMENT_ID) ); /*==============================================================*/ /* Table : MODULE_ASSIGNMENT */ /*==============================================================*/ create table if not exists MODULE_ASSIGNMENT ( MODULE_ID int not null, ASSIGNMENT_ID int not null, primary key (MODULE_ID, ASSIGNMENT_ID) );