-- phpMyAdmin SQL Dump -- version 5.2.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Oct 29, 2024 at 05:33 PM -- Server version: 5.7.44 -- PHP Version: 8.1.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `goree_schedule` -- -- -------------------------------------------------------- -- -- Stand-in structure for view `ClassScheduleView` -- (See below for the actual view) -- CREATE TABLE `ClassScheduleView` ( `course_name` varchar(100) ,`course_id` int(11) ,`room` varchar(20) ,`location_id` int(11) ,`type_name` varchar(50) ,`type_id` int(11) ,`meeting_date` date ,`start_time` time ,`end_time` time ); -- -------------------------------------------------------- -- -- Table structure for table `courses` -- CREATE TABLE `courses` ( `course_id` int(11) NOT NULL, `course_name` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `courses` -- INSERT INTO `courses` (`course_id`, `course_name`) VALUES (1, 'ACAD 276 Dev 2'), (2, 'ACAD 230 Intro to Physical Computing'), (3, 'ACAD 324 The Practice of Design'), (5, 'IDSN 524 Physical Product Design'), (6, 'dev 3'), (7, 'dev 3'), (8, 'dev 2'), (9, 'dev 3'), (10, 'dev 3'); -- -------------------------------------------------------- -- -- Table structure for table `locations` -- CREATE TABLE `locations` ( `location_id` int(11) NOT NULL, `room` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `locations` -- INSERT INTO `locations` (`location_id`, `room`) VALUES (1, 'IYH110'), (2, 'IYH212/213'), (3, 'IYH 210/211'), (4, 'IYH 111'); -- -------------------------------------------------------- -- -- Table structure for table `meeting_types` -- CREATE TABLE `meeting_types` ( `type_id` int(11) NOT NULL, `type_name` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `meeting_types` -- INSERT INTO `meeting_types` (`type_id`, `type_name`) VALUES (1, 'Lecture'), (2, 'Lecture'), (3, 'Lecture-Lab'), (4, 'Lecture-Lab'); -- -------------------------------------------------------- -- -- Table structure for table `schedule table` -- CREATE TABLE `schedule table` ( `meeting_id` int(11) NOT NULL, `course_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, `type_id` int(11) NOT NULL, `meeting_date` date NOT NULL, `start_time` time NOT NULL, `end_time` time NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `schedule table` -- INSERT INTO `schedule table` (`meeting_id`, `course_id`, `location_id`, `type_id`, `meeting_date`, `start_time`, `end_time`) VALUES (3, 2, 1, 1, '2024-09-23', '12:00:00', '01:50:00'), (4, 2, 4, 1, '2024-09-25', '12:00:00', '01:50:00'), (5, 2, 1, 1, '2024-09-30', '12:00:00', '01:50:00'), (6, 2, 4, 1, '2024-10-02', '12:00:00', '01:50:00'), (7, 2, 1, 1, '2024-10-07', '12:00:00', '01:50:00'), (8, 2, 4, 1, '2024-10-09', '12:00:00', '01:50:00'), (9, 2, 1, 1, '2024-10-14', '12:00:00', '01:50:00'), (10, 2, 4, 1, '2024-10-16', '12:00:00', '01:50:00'), (11, 1, 3, 2, '2024-09-24', '02:00:00', '04:50:00'), (12, 1, 3, 2, '2024-09-26', '02:00:00', '04:50:00'), (13, 1, 3, 2, '2024-10-01', '02:00:00', '04:50:00'), (14, 1, 3, 2, '2024-10-03', '02:00:00', '04:50:00'), (15, 1, 3, 2, '2024-10-08', '02:00:00', '04:50:00'), (16, 1, 3, 2, '2024-10-10', '02:00:00', '04:50:00'), (17, 1, 3, 2, '2024-10-15', '02:00:00', '04:50:00'), (18, 1, 3, 2, '2024-10-17', '02:00:00', '04:50:00'), (19, 3, 2, 2, '2024-09-24', '09:00:00', '11:50:00'), (20, 3, 2, 2, '2024-09-26', '09:00:00', '11:50:00'), (21, 3, 2, 2, '2024-10-01', '09:00:00', '11:50:00'), (22, 3, 2, 2, '2024-10-03', '09:00:00', '11:50:00'), (23, 3, 2, 2, '2024-10-08', '09:00:00', '11:50:00'), (24, 3, 2, 2, '2024-10-10', '09:00:00', '11:50:00'), (25, 3, 2, 2, '2024-10-15', '09:00:00', '11:50:00'), (26, 3, 2, 2, '2024-10-17', '09:00:00', '11:50:00'), (27, 5, 1, 3, '2024-09-24', '17:00:00', '19:00:00'), (29, 5, 1, 3, '2024-10-01', '17:00:00', '19:00:00'), (30, 5, 1, 3, '2024-10-08', '17:00:00', '19:00:00'), (31, 5, 1, 3, '2024-10-15', '17:00:00', '19:00:00'), (32, 2, 1, 1, '2024-10-21', '12:00:00', '01:50:00'), (33, 2, 1, 1, '2024-10-23', '12:00:00', '01:50:00'), (34, 2, 1, 1, '2024-10-28', '12:00:00', '01:50:00'), (35, 1, 3, 2, '2024-10-22', '02:00:00', '04:50:00'), (36, 1, 3, 2, '2024-10-24', '02:00:00', '04:50:00'), (37, 1, 3, 2, '2024-10-29', '02:00:00', '04:50:00'), (38, 1, 3, 2, '2024-10-31', '02:00:00', '04:50:00'), (39, 3, 2, 1, '2024-10-22', '09:00:00', '11:50:00'), (40, 3, 2, 1, '2024-10-24', '09:00:00', '11:50:00'), (41, 3, 2, 1, '2024-10-29', '09:00:00', '11:50:00'), (42, 3, 2, 1, '2024-10-31', '09:00:00', '11:50:00'), (43, 5, 1, 3, '2024-10-22', '17:00:00', '19:00:00'), (44, 5, 1, 3, '2024-10-29', '17:00:00', '19:00:00'), (45, 1, 1, 1, '2024-10-16', '12:39:30', '14:39:33'); -- -------------------------------------------------------- -- -- Structure for view `ClassScheduleView` -- DROP TABLE IF EXISTS `ClassScheduleView`; CREATE ALGORITHM=UNDEFINED DEFINER=`goree`@`localhost` SQL SECURITY DEFINER VIEW `ClassScheduleView` AS SELECT `courses`.`course_name` AS `course_name`, `courses`.`course_id` AS `course_id`, `locations`.`room` AS `room`, `locations`.`location_id` AS `location_id`, `meeting_types`.`type_name` AS `type_name`, `meeting_types`.`type_id` AS `type_id`, `schedule table`.`meeting_date` AS `meeting_date`, `schedule table`.`start_time` AS `start_time`, `schedule table`.`end_time` AS `end_time` FROM (((`courses` join `locations`) join `meeting_types`) join `schedule table`) WHERE ((`courses`.`course_id` = `schedule table`.`course_id`) AND (`locations`.`location_id` = `schedule table`.`location_id`) AND (`meeting_types`.`type_id` = `schedule table`.`type_id`)) ; -- -- Indexes for dumped tables -- -- -- Indexes for table `courses` -- ALTER TABLE `courses` ADD PRIMARY KEY (`course_id`); -- -- Indexes for table `locations` -- ALTER TABLE `locations` ADD PRIMARY KEY (`location_id`); -- -- Indexes for table `meeting_types` -- ALTER TABLE `meeting_types` ADD PRIMARY KEY (`type_id`); -- -- Indexes for table `schedule table` -- ALTER TABLE `schedule table` ADD PRIMARY KEY (`meeting_id`), ADD KEY `course_id` (`course_id`,`location_id`,`type_id`), ADD KEY `schedule table_ibfk_2` (`location_id`), ADD KEY `schedule table_ibfk_3` (`type_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `courses` -- ALTER TABLE `courses` MODIFY `course_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `locations` -- ALTER TABLE `locations` MODIFY `location_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `meeting_types` -- ALTER TABLE `meeting_types` MODIFY `type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `schedule table` -- ALTER TABLE `schedule table` MODIFY `meeting_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46; -- -- Constraints for dumped tables -- -- -- Constraints for table `schedule table` -- ALTER TABLE `schedule table` ADD CONSTRAINT `schedule table_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`), ADD CONSTRAINT `schedule table_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`), ADD CONSTRAINT `schedule table_ibfk_3` FOREIGN KEY (`type_id`) REFERENCES `meeting_types` (`type_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;