-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 28, 2026 at 03:12 PM
-- Server version: 5.7.44
-- PHP Version: 8.1.34

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: `graden_schedule`
--

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

--
-- Table structure for table `classes`
--

CREATE TABLE `classes` (
  `id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  `class_name_id` int(11) NOT NULL,
  `start_time_id` int(11) NOT NULL,
  `end_time_id` int(11) NOT NULL,
  `days_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL,
  `units_id` int(11) NOT NULL,
  `professor_id` int(11) NOT NULL,
  `type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `classes`
--

INSERT INTO `classes` (`id`, `date`, `class_name_id`, `start_time_id`, `end_time_id`, `days_id`, `location_id`, `units_id`, `professor_id`, `type_id`) VALUES
(1, '2026-09-08', 1, 1, 1, 2, 1, 2, 2, 1),
(2, '2026-09-08', 5, 2, 2, 2, 1, 2, 1, 2),
(3, '2026-09-07', 2, 1, 1, 1, 2, 2, 3, 1),
(4, '2026-09-07', 3, 4, 3, 1, 3, 2, 4, 1),
(5, '2026-09-08', 4, 3, 4, 2, 4, 1, 5, 1),
(6, '2026-09-10', 1, 1, 1, 2, 1, 2, 2, 1),
(7, '2026-09-10', 5, 2, 2, 2, 1, 2, 1, 2),
(8, '2026-09-09', 2, 1, 1, 1, 2, 2, 3, 1),
(9, '2026-09-09', 3, 4, 3, 1, 3, 2, 4, 1),
(10, '2026-09-10', 4, 3, 4, 2, 4, 1, 5, 1),
(11, '2026-09-15', 1, 1, 1, 2, 1, 2, 2, 1),
(12, '2026-09-15', 5, 2, 2, 2, 1, 2, 1, 2),
(13, '2026-09-14', 2, 1, 1, 1, 2, 2, 3, 1),
(14, '2026-09-14', 3, 4, 3, 1, 3, 2, 4, 1),
(15, '2026-09-15', 4, 3, 4, 2, 4, 1, 5, 1),
(16, '2026-09-17', 1, 1, 1, 2, 1, 2, 2, 1),
(17, '2026-09-17', 5, 2, 2, 2, 1, 2, 1, 2),
(18, '2026-09-16', 2, 1, 1, 1, 2, 2, 3, 1),
(19, '2026-09-16', 3, 4, 3, 1, 3, 2, 4, 1),
(20, '2026-09-17', 4, 3, 4, 2, 4, 1, 5, 1),
(21, '2026-09-22', 1, 1, 1, 2, 1, 2, 2, 1),
(22, '2026-09-22', 5, 2, 2, 2, 1, 2, 1, 2),
(23, '2026-09-21', 2, 1, 1, 1, 2, 2, 3, 1),
(24, '2026-09-21', 3, 4, 3, 1, 3, 2, 4, 1),
(25, '2026-09-22', 4, 3, 4, 2, 4, 1, 5, 1),
(26, '2026-09-24', 1, 1, 1, 2, 1, 2, 2, 1),
(27, '2026-09-24', 5, 2, 2, 2, 1, 2, 1, 2),
(28, '2026-09-23', 2, 1, 1, 1, 2, 2, 3, 1),
(29, '2026-09-23', 3, 4, 3, 1, 3, 2, 4, 1),
(30, '2026-09-24', 4, 3, 4, 2, 4, 1, 5, 1),
(31, '2026-09-29', 1, 1, 1, 2, 1, 2, 2, 1),
(32, '2026-09-29', 5, 2, 2, 2, 1, 2, 1, 2),
(33, '2026-09-28', 2, 1, 1, 1, 2, 2, 3, 1),
(34, '2026-09-28', 3, 4, 3, 1, 3, 2, 4, 1),
(35, '2026-09-29', 4, 3, 4, 2, 4, 1, 5, 1),
(36, '2026-10-01', 1, 1, 1, 2, 1, 2, 2, 1),
(37, '2026-10-01', 5, 2, 2, 2, 1, 2, 1, 2),
(38, '2026-09-30', 2, 1, 1, 1, 2, 2, 3, 1),
(39, '2026-09-30', 3, 4, 3, 1, 3, 2, 4, 1),
(40, '2026-10-01', 4, 3, 4, 2, 4, 1, 5, 1);

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

--
-- Table structure for table `class_names`
--

CREATE TABLE `class_names` (
  `id` int(11) NOT NULL,
  `class_name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `class_names`
--

INSERT INTO `class_names` (`id`, `class_name`) VALUES
(1, 'ACAD-185: Analytics and Marketing for Challenge-Based Innovation'),
(2, 'ACAD-324 g: The Practice of Design: Ideation to Innovation'),
(3, 'TAC-449: Applications of Machine Learning'),
(4, 'TAC-450: High Performance Computing in Applied Machine Learning'),
(5, 'ACAD-276: Dev II');

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

--
-- Stand-in structure for view `class_schedule_view`
-- (See below for the actual view)
--
CREATE TABLE `class_schedule_view` (
`id` int(11)
,`date` date
,`class_name` varchar(100)
,`start_time` time
,`end_time` time
,`days` varchar(8)
,`location` varchar(11)
,`units` int(11)
,`professor` varchar(50)
,`type` varchar(20)
);

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

--
-- Table structure for table `days`
--

CREATE TABLE `days` (
  `id` int(11) NOT NULL,
  `days` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `days`
--

INSERT INTO `days` (`id`, `days`) VALUES
(1, 'MW'),
(2, 'TTh'),
(3, 'F'),
(4, 'M'),
(5, 'T'),
(6, 'W'),
(7, 'T');

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

--
-- Table structure for table `end_times`
--

CREATE TABLE `end_times` (
  `id` int(11) NOT NULL,
  `end_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `end_times`
--

INSERT INTO `end_times` (`id`, `end_time`) VALUES
(1, '11:50:00'),
(2, '13:50:00'),
(3, '15:50:00'),
(4, '16:50:00');

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

--
-- Table structure for table `locations`
--

CREATE TABLE `locations` (
  `id` int(11) NOT NULL,
  `location` varchar(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `locations`
--

INSERT INTO `locations` (`id`, `location`) VALUES
(1, 'IYH210/211'),
(2, 'IYH212/213'),
(3, 'GFS101'),
(4, 'KAP267');

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

--
-- Table structure for table `professors`
--

CREATE TABLE `professors` (
  `id` int(11) NOT NULL,
  `professor` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `professors`
--

INSERT INTO `professors` (`id`, `professor`) VALUES
(1, 'Patrick Dent'),
(2, 'Chris Swain'),
(3, 'Davina Wolter'),
(4, 'Kristof Aldenderfer'),
(5, 'BD Kim');

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

--
-- Table structure for table `start_times`
--

CREATE TABLE `start_times` (
  `id` int(11) NOT NULL,
  `start_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `start_times`
--

INSERT INTO `start_times` (`id`, `start_time`) VALUES
(1, '10:00:00'),
(2, '12:00:00'),
(3, '16:00:00'),
(4, '14:00:00');

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

--
-- Table structure for table `types`
--

CREATE TABLE `types` (
  `id` int(11) NOT NULL,
  `type` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `types`
--

INSERT INTO `types` (`id`, `type`) VALUES
(1, 'Lecture'),
(2, 'Lecture-Lab');

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` int(11) NOT NULL,
  `units` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `units`) VALUES
(1, 2),
(2, 4);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `classes`
--
ALTER TABLE `classes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `class_name_fk` (`class_name_id`),
  ADD KEY `days_fk` (`days_id`),
  ADD KEY `end_times_fk` (`end_time_id`),
  ADD KEY `locations_fk` (`location_id`),
  ADD KEY `professors_fk` (`professor_id`),
  ADD KEY `start_times_fk` (`start_time_id`),
  ADD KEY `types_fk` (`type_id`),
  ADD KEY `units_fk` (`units_id`);

--
-- Indexes for table `class_names`
--
ALTER TABLE `class_names`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `days`
--
ALTER TABLE `days`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `end_times`
--
ALTER TABLE `end_times`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `locations`
--
ALTER TABLE `locations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `professors`
--
ALTER TABLE `professors`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `start_times`
--
ALTER TABLE `start_times`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `types`
--
ALTER TABLE `types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `classes`
--
ALTER TABLE `classes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `class_names`
--
ALTER TABLE `class_names`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `days`
--
ALTER TABLE `days`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `end_times`
--
ALTER TABLE `end_times`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `locations`
--
ALTER TABLE `locations`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `professors`
--
ALTER TABLE `professors`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `start_times`
--
ALTER TABLE `start_times`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `types`
--
ALTER TABLE `types`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

--
-- Structure for view `class_schedule_view`
--
DROP TABLE IF EXISTS `class_schedule_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`graden`@`localhost` SQL SECURITY DEFINER VIEW `class_schedule_view`  AS SELECT `classes`.`id` AS `id`, `classes`.`date` AS `date`, `class_names`.`class_name` AS `class_name`, `start_times`.`start_time` AS `start_time`, `end_times`.`end_time` AS `end_time`, `days`.`days` AS `days`, `locations`.`location` AS `location`, `units`.`units` AS `units`, `professors`.`professor` AS `professor`, `types`.`type` AS `type` FROM ((((((((`classes` join `class_names`) join `start_times`) join `end_times`) join `days`) join `locations`) join `units`) join `professors`) join `types`) WHERE ((`classes`.`class_name_id` = `class_names`.`id`) AND (`classes`.`start_time_id` = `start_times`.`id`) AND (`classes`.`end_time_id` = `end_times`.`id`) AND (`classes`.`days_id` = `days`.`id`) AND (`classes`.`location_id` = `locations`.`id`) AND (`classes`.`units_id` = `units`.`id`) AND (`classes`.`professor_id` = `professors`.`id`) AND (`classes`.`type_id` = `types`.`id`)) ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `classes`
--
ALTER TABLE `classes`
  ADD CONSTRAINT `class_name_fk` FOREIGN KEY (`class_name_id`) REFERENCES `class_names` (`id`),
  ADD CONSTRAINT `days_fk` FOREIGN KEY (`days_id`) REFERENCES `days` (`id`),
  ADD CONSTRAINT `end_times_fk` FOREIGN KEY (`end_time_id`) REFERENCES `end_times` (`id`),
  ADD CONSTRAINT `locations_fk` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`),
  ADD CONSTRAINT `professors_fk` FOREIGN KEY (`professor_id`) REFERENCES `professors` (`id`),
  ADD CONSTRAINT `start_times_fk` FOREIGN KEY (`start_time_id`) REFERENCES `start_times` (`id`),
  ADD CONSTRAINT `types_fk` FOREIGN KEY (`type_id`) REFERENCES `types` (`id`),
  ADD CONSTRAINT `units_fk` FOREIGN KEY (`units_id`) REFERENCES `units` (`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 */;
