-- phpMyAdmin SQL Dump -- version 3.3.2deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 24, 2011 at 04:51 PM -- Server version: 5.1.41 -- PHP Version: 5.3.2-1ubuntu4.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `CompLabTimetable` -- -- -------------------------------------------------------- -- -- Table structure for table `labdetails` -- CREATE TABLE IF NOT EXISTS `labdetails` ( `LabId` int(15) unsigned NOT NULL AUTO_INCREMENT, `LabName` varchar(20) NOT NULL, `LabOpeningTime` time DEFAULT NULL, `LabClosingTime` time DEFAULT NULL, PRIMARY KEY (`LabId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `labdetails` -- INSERT INTO `labdetails` (`LabId`, `LabName`, `LabOpeningTime`, `LabClosingTime`) VALUES (1, 'Menengai', '08:00:00', '20:00:00'), (2, 'Kiambere', '08:00:00', '20:00:00'), (3, 'Suswa', '08:00:00', '20:00:00'), (4, 'Elgon', '08:00:00', '20:00:00'), (5, 'Aberdare', '08:00:00', '20:00:00'), (6, 'Longonot', '08:00:00', '20:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `labunit` -- CREATE TABLE IF NOT EXISTS `labunit` ( `UnitId` int(11) NOT NULL AUTO_INCREMENT, `UnitName` varchar(45) DEFAULT 'LabLecture', `UnitFaculty` varchar(45) DEFAULT 'UnNamed Lecture Faculty', `IdSessionTime` int(15) unsigned DEFAULT NULL, PRIMARY KEY (`UnitId`), UNIQUE KEY `IdSessionTime_UNIQUE` (`IdSessionTime`), KEY `IdSessionTime` (`IdSessionTime`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='The Class Table contains information about the session to be' AUTO_INCREMENT=4 ; -- -- Dumping data for table `labunit` -- INSERT INTO `labunit` (`UnitId`, `UnitName`, `UnitFaculty`, `IdSessionTime`) VALUES (1, 'Advanced Networking', 'FIT', NULL), (2, 'Sage', 'Fcom', NULL), (3, 'Pastel', 'SOA', NULL); -- -------------------------------------------------------- -- -- Table structure for table `lab_sessiontime` -- CREATE TABLE IF NOT EXISTS `lab_sessiontime` ( `IdSessionTime` int(15) unsigned NOT NULL AUTO_INCREMENT, `Start_time` time NOT NULL, `End_time` time NOT NULL, `Day_Of_Week` varchar(45) NOT NULL, `LabID` int(15) unsigned NOT NULL, PRIMARY KEY (`IdSessionTime`,`Start_time`,`End_time`,`Day_Of_Week`), KEY `Lab_ID` (`LabID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Dumping data for table `lab_sessiontime` -- INSERT INTO `lab_sessiontime` (`IdSessionTime`, `Start_time`, `End_time`, `Day_Of_Week`, `LabID`) VALUES (5, '14:30:00', '15:00:00', 'Saturday', 1), (3, '11:15:00', '12:15:00', 'Tuesday', 3), (1, '08:15:00', '10:15:00', 'Monday', 5), (2, '11:15:00', '01:15:00', 'Monday', 5); -- -- Constraints for dumped tables -- -- -- Constraints for table `labunit` -- ALTER TABLE `labunit` ADD CONSTRAINT `IdSessionTime` FOREIGN KEY (`IdSessionTime`) REFERENCES `lab_sessiontime` (`IdSessionTime`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `lab_sessiontime` -- ALTER TABLE `lab_sessiontime` ADD CONSTRAINT `Lab_ID` FOREIGN KEY (`LabID`) REFERENCES `labdetails` (`LabId`) ON DELETE NO ACTION ON UPDATE NO ACTION;