 -- ----------------------------
 DROP TABLE IF EXISTS `slot`;
 CREATE TABLE `slot` (
-  `slot_id` int(20) NOT NULL,
+  `slot_id` int(20) NOT NULL AUTO_INCREMENT,
   `start_date` datetime(6) DEFAULT NULL,
   `end_date` datetime(6) DEFAULT NULL,
-  `avalibility` bit(1) DEFAULT NULL,
-  PRIMARY KEY (`slot_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+  `student_id` int(20) DEFAULT NULL,
+  `inspector_id` int(20) DEFAULT NULL,
+  PRIMARY KEY (`slot_id`),
+  KEY `student_id` (`student_id`),
+  KEY `inspector_id` (`inspector_id`),
+  CONSTRAINT `slot_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `student` (`student_id`),
+  CONSTRAINT `slot_ibfk_2` FOREIGN KEY (`inspector_id`) REFERENCES `inspector` (`inspector_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
 
 -- ----------------------------
 -- Records of slot
 -- ----------------------------
+INSERT INTO `slot` VALUES ('2', '2014-11-11 11:30:00.000000', '2014-11-11 14:00:00.000000', '1', null);
 
 -- ----------------------------
 -- Table structure for student
 -- ----------------------------
 DROP TABLE IF EXISTS `student`;
 CREATE TABLE `student` (
-  `student_id` int(20) NOT NULL,
+  `student_id` int(20) NOT NULL AUTO_INCREMENT,
   `first_name` varchar(45) DEFAULT NULL,
   `last_name` varchar(45) DEFAULT NULL,
   `email` varchar(45) DEFAULT NULL,
-  `project_id` int(45) DEFAULT NULL,
-  `project_title` varchar(45) DEFAULT NULL,
+  `project_title` varchar(255) DEFAULT NULL,
   `project_description` varchar(255) DEFAULT NULL,
   `supervisor` varchar(45) DEFAULT NULL,
   `username` char(20) NOT NULL,
   `password` varchar(45) DEFAULT NULL,
-  `timetable_id` int(20) DEFAULT NULL,
-  `course_id` int(20) DEFAULT NULL,
   `module_id` int(20) DEFAULT NULL,
   PRIMARY KEY (`student_id`),
-  KEY `course_id` (`course_id`),
   KEY `module_id` (`module_id`),
-  CONSTRAINT `student_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `course` (`course_id`),
-  CONSTRAINT `student_ibfk_2` FOREIGN KEY (`module_id`) REFERENCES `module` (`module_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+  KEY `supervisor` (`supervisor`),
+  CONSTRAINT `student_ibfk_2` FOREIGN KEY (`module_id`) REFERENCES `module` (`module_id`),
+  CONSTRAINT `student_ibfk_3` FOREIGN KEY (`supervisor`) REFERENCES `inspector` (`username`)
+) ENGINE=InnoDB AUTO_INCREMENT=153 DEFAULT CHARSET=utf8;
 
 -- ----------------------------
 -- Records of student
 -- ----------------------------
-INSERT INTO `student` VALUES ('123456', 'Christopher', 'Wright', 'cxw518@student.bham.ac.uk', null, 'mage Analysis for Angiogenesis', '', null, 'cxw518', '123456', '2', '14', '26587');
-INSERT INTO `student` VALUES ('1488913', 'Chenxin', 'Zhao', 'cxz413@student.bham.ac.uk', null, 'Analysing Algorithms', 'Data structure', null, 'cxz413', '123456', '1', '14', '26587');
-
--- ----------------------------
--- Table structure for timetable
--- ----------------------------
-DROP TABLE IF EXISTS `timetable`;
-CREATE TABLE `timetable` (
-  `timetable_id` int(20) NOT NULL,
-  `slot_id` int(20) DEFAULT NULL,
-  PRIMARY KEY (`timetable_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
--- ----------------------------
--- Records of timetable
--- ----------------------------
+INSERT INTO `student` VALUES ('1', 'Chenxin', 'Zhao', 'cxz413@bham.ac.uk', null, 'Artificital', 'Zhiwei', 'cxz413', 'cxz413', '26581');
+
+-- ----------------------------
+-- Table structure for student_keyword
+-- ----------------------------
+DROP TABLE IF EXISTS `student_keyword`;
+CREATE TABLE `student_keyword` (
+  `student_keyword_id` int(20) NOT NULL AUTO_INCREMENT,
+  `keyword_id` int(20) DEFAULT NULL,
+  `student_id` int(20) DEFAULT NULL,
+  PRIMARY KEY (`student_keyword_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Records of student_keyword
+-- ----------------------------
+INSERT INTO `student_keyword` VALUES ('10', '2', '1');
+INSERT INTO `student_keyword` VALUES ('13', '1', '2');
+INSERT INTO `student_keyword` VALUES ('14', '1', '3');
+INSERT INTO `student_keyword` VALUES ('15', '2', '3');
+INSERT INTO `student_keyword` VALUES ('16', '3', '3');

  `dissertation_deadline` datetime(6) DEFAULT NULL,
  `pc_id` int(20) DEFAULT NULL,
  PRIMARY KEY (`module_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of module

-- ----------------------------
DROP TABLE IF EXISTS `first_inspection`;
CREATE TABLE `first_inspection` (
  `first_inspection_id` int(20) NOT NULL AUTO_INCREMENT,
  `student_id` int(20) DEFAULT '0',
  `inspector_id` int(20) DEFAULT NULL,
  `module_id` int(20) DEFAULT NULL,
  `date` datetime(6) DEFAULT NULL,
  `first_inspectioncol` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`first_inspection_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
