-- phpMyAdmin SQL Dump -- version 5.2.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Sep 24, 2025 at 01:13 PM -- Server version: 5.7.44 -- PHP Version: 8.1.31 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: `avshah_schedule` -- -- -------------------------------------------------------- -- -- Table structure for table `courses` -- CREATE TABLE `courses` ( `course_id` int(11) NOT NULL, `course_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `section` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `instructor_id` int(11) NOT NULL, `default_location_id` int(11) NOT NULL, `default_meeting_type_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `courses` -- INSERT INTO `courses` (`course_id`, `course_code`, `section`, `title`, `instructor_id`, `default_location_id`, `default_meeting_type_id`) VALUES (1, 'ACAD 324', '10248', 'The Practice of Design: Ideation to Innovation', 2, 4, 1), (2, 'ACAD 230', '10227', 'Introduction to Interactive Physical Computing', 3, 2, 1), (3, 'ACAD 276', '10242', 'Dev II', 4, 3, 2), (4, 'IDSN 599', '34151', 'Special Topics', 5, 4, 1), (5, 'TAC 404', '31881', 'Advanced Front-End Web Development', 1, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `instructors` -- CREATE TABLE `instructors` ( `instructor_id` int(11) NOT NULL, `first_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `last_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `instructors` -- INSERT INTO `instructors` (`instructor_id`, `first_name`, `last_name`) VALUES (1, 'David', 'Tang'), (2, 'Davina', 'Wolter'), (3, 'John', 'Bruneau'), (4, 'Patrick', 'Dent'), (5, 'Thomas', 'Dadourian'); -- -------------------------------------------------------- -- -- Table structure for table `locations` -- CREATE TABLE `locations` ( `location_id` int(11) NOT NULL, `building_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `room` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `locations` -- INSERT INTO `locations` (`location_id`, `building_code`, `room`) VALUES (1, 'GFS', '228'), (2, 'IYH', '111'), (3, 'IYH', '210'), (4, 'IYH', '212/213'); -- -------------------------------------------------------- -- -- Table structure for table `meetings` -- CREATE TABLE `meetings` ( `meeting_id` int(11) NOT NULL, `course_id` int(11) NOT NULL, `meeting_date` date NOT NULL, `start_time` time NOT NULL, `end_time` time NOT NULL, `location_id` int(11) NOT NULL, `meeting_type_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `meetings` -- INSERT INTO `meetings` (`meeting_id`, `course_id`, `meeting_date`, `start_time`, `end_time`, `location_id`, `meeting_type_id`) VALUES (1, 1, '2025-09-15', '10:00:00', '11:50:00', 4, 1), (2, 1, '2025-09-22', '10:00:00', '11:50:00', 4, 1), (3, 1, '2025-09-29', '10:00:00', '11:50:00', 4, 1), (4, 1, '2025-10-06', '10:00:00', '11:50:00', 4, 1), (5, 1, '2025-09-17', '10:00:00', '11:50:00', 4, 1), (6, 1, '2025-09-24', '10:00:00', '11:50:00', 4, 1), (7, 1, '2025-10-01', '10:00:00', '11:50:00', 4, 1), (8, 1, '2025-10-08', '10:00:00', '11:50:00', 4, 1), (9, 2, '2025-09-16', '12:00:00', '13:50:00', 2, 1), (10, 2, '2025-09-23', '12:00:00', '13:50:00', 2, 1), (11, 2, '2025-09-30', '12:00:00', '13:50:00', 2, 1), (12, 2, '2025-10-07', '12:00:00', '13:50:00', 2, 1), (13, 2, '2025-09-18', '12:00:00', '13:50:00', 2, 1), (14, 2, '2025-09-25', '12:00:00', '13:50:00', 2, 1), (15, 2, '2025-10-02', '12:00:00', '13:50:00', 2, 1), (16, 2, '2025-10-09', '12:00:00', '13:50:00', 2, 1), (17, 3, '2025-09-16', '14:00:00', '15:50:00', 3, 2), (18, 3, '2025-09-23', '14:00:00', '15:50:00', 3, 2), (19, 3, '2025-09-30', '14:00:00', '15:50:00', 3, 2), (20, 3, '2025-10-07', '14:00:00', '15:50:00', 3, 2), (21, 3, '2025-09-18', '14:00:00', '15:50:00', 3, 2), (22, 3, '2025-09-25', '14:00:00', '15:50:00', 3, 2), (23, 3, '2025-10-02', '14:00:00', '15:50:00', 3, 2), (24, 3, '2025-10-09', '14:00:00', '15:50:00', 3, 2), (25, 4, '2025-09-17', '14:00:00', '15:50:00', 4, 1), (26, 4, '2025-09-24', '14:00:00', '15:50:00', 4, 1), (27, 4, '2025-10-01', '14:00:00', '15:50:00', 4, 1), (28, 4, '2025-10-08', '14:00:00', '15:50:00', 4, 1), (29, 5, '2025-09-15', '17:00:00', '20:50:00', 1, 1), (30, 5, '2025-09-22', '17:00:00', '20:50:00', 1, 1), (31, 5, '2025-09-29', '17:00:00', '20:50:00', 1, 1), (32, 5, '2025-10-06', '17:00:00', '20:50:00', 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `meeting_types` -- CREATE TABLE `meeting_types` ( `meeting_type_id` int(11) NOT NULL, `type_name` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `meeting_types` -- INSERT INTO `meeting_types` (`meeting_type_id`, `type_name`) VALUES (1, 'Lecture'), (2, 'Lecture/Lab'); -- -------------------------------------------------------- -- -- Stand-in structure for view `v_schedule_full` -- (See below for the actual view) -- CREATE TABLE `v_schedule_full` ( `date` date ,`start_time` varchar(8) ,`end_time` varchar(8) ,`location` varchar(30) ,`meeting_type` varchar(30) ,`course_title` varchar(277) ,`section` varchar(10) ,`instructor` varchar(101) ); -- -------------------------------------------------------- -- -- Stand-in structure for view `v_schedule_full_ids` -- (See below for the actual view) -- CREATE TABLE `v_schedule_full_ids` ( `meeting_id` int(11) ,`course_id` int(11) ,`date` date ,`start_time` varchar(8) ,`end_time` varchar(8) ,`location` varchar(30) ,`meeting_type` varchar(30) ,`course_title` varchar(277) ,`section` varchar(10) ,`instructor` varchar(101) ); -- -------------------------------------------------------- -- -- Structure for view `v_schedule_full` -- DROP TABLE IF EXISTS `v_schedule_full`; CREATE ALGORITHM=UNDEFINED DEFINER=`avshah`@`localhost` SQL SECURITY DEFINER VIEW `v_schedule_full` AS SELECT `m`.`meeting_date` AS `date`, time_format(`m`.`start_time`,'%h:%i %p') AS `start_time`, time_format(`m`.`end_time`,'%h:%i %p') AS `end_time`, concat(`l`.`building_code`,`l`.`room`) AS `location`, `mt`.`type_name` AS `meeting_type`, concat(`c`.`course_code`,': ',`c`.`title`) AS `course_title`, `c`.`section` AS `section`, concat(`i`.`first_name`,' ',`i`.`last_name`) AS `instructor` FROM ((((`meetings` `m` join `courses` `c` on((`m`.`course_id` = `c`.`course_id`))) join `instructors` `i` on((`c`.`instructor_id` = `i`.`instructor_id`))) join `locations` `l` on((`m`.`location_id` = `l`.`location_id`))) join `meeting_types` `mt` on((`m`.`meeting_type_id` = `mt`.`meeting_type_id`))) ORDER BY `m`.`meeting_date` ASC, `m`.`start_time` ASC, `c`.`course_code` ASC ; -- -------------------------------------------------------- -- -- Structure for view `v_schedule_full_ids` -- DROP TABLE IF EXISTS `v_schedule_full_ids`; CREATE ALGORITHM=UNDEFINED DEFINER=`avshah`@`localhost` SQL SECURITY DEFINER VIEW `v_schedule_full_ids` AS SELECT `m`.`meeting_id` AS `meeting_id`, `m`.`course_id` AS `course_id`, `m`.`meeting_date` AS `date`, time_format(`m`.`start_time`,'%h:%i %p') AS `start_time`, time_format(`m`.`end_time`,'%h:%i %p') AS `end_time`, concat(`l`.`building_code`,`l`.`room`) AS `location`, `mt`.`type_name` AS `meeting_type`, concat(`c`.`course_code`,': ',`c`.`title`) AS `course_title`, `c`.`section` AS `section`, concat(`i`.`first_name`,' ',`i`.`last_name`) AS `instructor` FROM ((((`meetings` `m` join `courses` `c` on((`m`.`course_id` = `c`.`course_id`))) join `instructors` `i` on((`c`.`instructor_id` = `i`.`instructor_id`))) join `locations` `l` on((`m`.`location_id` = `l`.`location_id`))) join `meeting_types` `mt` on((`m`.`meeting_type_id` = `mt`.`meeting_type_id`))) ORDER BY `m`.`meeting_date` ASC, `m`.`start_time` ASC, `c`.`course_code` ASC ; -- -- Indexes for dumped tables -- -- -- Indexes for table `courses` -- ALTER TABLE `courses` ADD PRIMARY KEY (`course_id`), ADD UNIQUE KEY `uniq_course` (`course_code`,`section`), ADD KEY `fk_courses_instructor` (`instructor_id`), ADD KEY `fk_courses_location` (`default_location_id`), ADD KEY `fk_courses_meetingtype` (`default_meeting_type_id`); -- -- Indexes for table `instructors` -- ALTER TABLE `instructors` ADD PRIMARY KEY (`instructor_id`), ADD UNIQUE KEY `uniq_instructor` (`first_name`,`last_name`); -- -- Indexes for table `locations` -- ALTER TABLE `locations` ADD PRIMARY KEY (`location_id`), ADD UNIQUE KEY `uniq_location` (`building_code`,`room`); -- -- Indexes for table `meetings` -- ALTER TABLE `meetings` ADD PRIMARY KEY (`meeting_id`), ADD KEY `fk_meetings_course` (`course_id`), ADD KEY `fk_meetings_location` (`location_id`), ADD KEY `fk_meetings_meetingtype` (`meeting_type_id`), ADD KEY `idx_meetings_date` (`meeting_date`); -- -- Indexes for table `meeting_types` -- ALTER TABLE `meeting_types` ADD PRIMARY KEY (`meeting_type_id`), ADD UNIQUE KEY `type_name` (`type_name`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `courses` -- ALTER TABLE `courses` MODIFY `course_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `instructors` -- ALTER TABLE `instructors` MODIFY `instructor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `locations` -- ALTER TABLE `locations` MODIFY `location_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `meetings` -- ALTER TABLE `meetings` MODIFY `meeting_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- AUTO_INCREMENT for table `meeting_types` -- ALTER TABLE `meeting_types` MODIFY `meeting_type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `courses` -- ALTER TABLE `courses` ADD CONSTRAINT `fk_courses_instructor` FOREIGN KEY (`instructor_id`) REFERENCES `instructors` (`instructor_id`), ADD CONSTRAINT `fk_courses_location` FOREIGN KEY (`default_location_id`) REFERENCES `locations` (`location_id`), ADD CONSTRAINT `fk_courses_meetingtype` FOREIGN KEY (`default_meeting_type_id`) REFERENCES `meeting_types` (`meeting_type_id`); -- -- Constraints for table `meetings` -- ALTER TABLE `meetings` ADD CONSTRAINT `fk_meetings_course` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`) ON DELETE CASCADE, ADD CONSTRAINT `fk_meetings_location` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`), ADD CONSTRAINT `fk_meetings_meetingtype` FOREIGN KEY (`meeting_type_id`) REFERENCES `meeting_types` (`meeting_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 */;