-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 22, 2026 at 07:36 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: `peumans_schedule`
--

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

--
-- Table structure for table `classSchedule`
--

CREATE TABLE `classSchedule` (
  `ID` int(11) NOT NULL,
  `Date` date NOT NULL,
  `timeStart` time NOT NULL,
  `timeEnd` time NOT NULL,
  `courseID` int(11) NOT NULL,
  `professorID` int(11) NOT NULL,
  `roomID` int(11) NOT NULL,
  `coursetypeID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `classSchedule`
--

INSERT INTO `classSchedule` (`ID`, `Date`, `timeStart`, `timeEnd`, `courseID`, `professorID`, `roomID`, `coursetypeID`) VALUES
(1, '2026-08-24', '11:00:00', '11:50:00', 3, 3, 3, 2),
(2, '2026-08-24', '12:00:00', '15:50:00', 5, 5, 5, 2),
(3, '2026-08-25', '12:00:00', '13:50:00', 1, 1, 1, 1),
(4, '2026-08-25', '14:00:00', '15:50:00', 2, 2, 2, 2),
(5, '2026-08-26', '11:00:00', '11:50:00', 3, 3, 3, 2),
(6, '2026-08-26', '12:00:00', '13:50:00', 4, 4, 4, 2),
(7, '2026-08-26', '14:00:00', '13:50:00', 5, 5, 5, 2),
(8, '2026-08-27', '12:00:00', '13:50:00', 1, 1, 1, 1),
(9, '2026-08-27', '14:00:00', '15:50:00', 2, 2, 2, 2),
(10, '2026-08-28', '12:00:00', '13:50:00', 4, 4, 4, 2),
(11, '2026-08-31', '11:00:00', '11:50:00', 3, 3, 3, 2),
(12, '2026-08-31', '12:00:00', '15:50:00', 5, 5, 5, 2),
(13, '2026-09-01', '12:00:00', '13:50:00', 1, 1, 1, 1),
(14, '2026-09-01', '14:00:00', '15:50:00', 2, 2, 2, 2),
(15, '2026-09-02', '11:00:00', '11:50:00', 3, 3, 3, 2),
(16, '2026-09-02', '12:00:00', '13:50:00', 4, 4, 4, 2),
(17, '2026-09-02', '14:00:00', '13:50:00', 5, 5, 5, 2),
(18, '2026-09-03', '12:00:00', '13:50:00', 1, 1, 1, 1),
(19, '2026-09-03', '14:00:00', '15:50:00', 2, 2, 2, 2),
(20, '2026-09-04', '12:00:00', '13:50:00', 4, 4, 4, 2),
(21, '2026-09-07', '11:00:00', '11:50:00', 3, 3, 3, 2),
(22, '2026-09-07', '12:00:00', '15:50:00', 5, 5, 5, 2),
(23, '2026-09-08', '12:00:00', '13:50:00', 1, 1, 1, 1),
(24, '2026-09-08', '14:00:00', '15:50:00', 2, 2, 2, 2),
(25, '2026-09-09', '11:00:00', '11:50:00', 3, 3, 3, 2),
(26, '2026-09-02', '12:00:00', '13:50:00', 4, 4, 4, 2),
(27, '2026-09-09', '14:00:00', '13:50:00', 5, 5, 5, 2),
(28, '2026-09-10', '12:00:00', '13:50:00', 1, 1, 1, 1),
(29, '2026-09-10', '14:00:00', '15:50:00', 2, 2, 2, 2),
(30, '2026-09-11', '12:00:00', '13:50:00', 4, 4, 4, 2),
(31, '2026-09-14', '11:00:00', '11:50:00', 3, 3, 3, 2),
(32, '2026-09-14', '12:00:00', '15:50:00', 5, 5, 5, 2),
(33, '2026-09-15', '12:00:00', '13:50:00', 1, 1, 1, 1),
(34, '2026-09-15', '14:00:00', '15:50:00', 2, 2, 2, 2),
(35, '2026-09-16', '11:00:00', '11:50:00', 3, 3, 3, 2),
(36, '2026-09-16', '12:00:00', '13:50:00', 4, 4, 4, 2),
(37, '2026-09-16', '14:00:00', '13:50:00', 5, 5, 5, 2),
(38, '2026-09-17', '12:00:00', '13:50:00', 1, 1, 1, 1),
(39, '2026-09-17', '14:00:00', '15:50:00', 2, 2, 2, 2),
(40, '2026-09-18', '12:00:00', '13:50:00', 4, 4, 4, 2);

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

--
-- Stand-in structure for view `classSchedule_view`
-- (See below for the actual view)
--
CREATE TABLE `classSchedule_view` (
`ID` int(11)
,`Date` date
,`timeStart` time
,`timeEnd` time
,`courseName` varchar(50)
,`professorName` varchar(50)
,`roomName` varchar(50)
,`classTypeName` varchar(50)
);

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

--
-- Table structure for table `classTypes`
--

CREATE TABLE `classTypes` (
  `ID` int(11) NOT NULL,
  `classTypeName` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `classTypes`
--

INSERT INTO `classTypes` (`ID`, `classTypeName`) VALUES
(1, 'Lecture/Lab'),
(2, 'Lecture');

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

--
-- Table structure for table `courses`
--

CREATE TABLE `courses` (
  `ID` int(11) NOT NULL,
  `courseName` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `courses`
--

INSERT INTO `courses` (`ID`, `courseName`) VALUES
(1, 'ACAD 276: Dev II'),
(2, 'BAEP 455: Founders Dilemmas'),
(3, 'PHED 120A: Yoga'),
(4, 'ACAD 376: Industry Practicum'),
(5, 'BME 511: Physiological Control Systems');

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

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

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

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

INSERT INTO `professors` (`ID`, `professorName`) VALUES
(1, 'Patrick Dent'),
(2, 'Audra Quinn'),
(3, 'Salena Collins'),
(4, 'Thomas Dadourian & Lihyun Lim'),
(5, 'Michael Khoo');

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

--
-- Table structure for table `rooms`
--

CREATE TABLE `rooms` (
  `ID` int(11) NOT NULL,
  `roomName` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `rooms`
--

INSERT INTO `rooms` (`ID`, `roomName`) VALUES
(1, 'IYH 210'),
(2, 'JFF 416'),
(3, 'PED Basement'),
(4, 'THH 202'),
(5, 'OHE 100B');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `classSchedule`
--
ALTER TABLE `classSchedule`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `courseID` (`courseID`),
  ADD KEY `coursetypeID` (`coursetypeID`),
  ADD KEY `professorID` (`professorID`),
  ADD KEY `roomID` (`roomID`);

--
-- Indexes for table `classTypes`
--
ALTER TABLE `classTypes`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
  ADD PRIMARY KEY (`ID`);

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

--
-- Indexes for table `rooms`
--
ALTER TABLE `rooms`
  ADD PRIMARY KEY (`ID`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`peumans`@`localhost` SQL SECURITY DEFINER VIEW `classSchedule_view`  AS SELECT `classSchedule`.`ID` AS `ID`, `classSchedule`.`Date` AS `Date`, `classSchedule`.`timeStart` AS `timeStart`, `classSchedule`.`timeEnd` AS `timeEnd`, `courses`.`courseName` AS `courseName`, `professors`.`professorName` AS `professorName`, `rooms`.`roomName` AS `roomName`, `classTypes`.`classTypeName` AS `classTypeName` FROM ((((`classSchedule` join `courses`) join `professors`) join `rooms`) join `classTypes`) WHERE ((`classSchedule`.`courseID` = `courses`.`ID`) AND (`classSchedule`.`professorID` = `professors`.`ID`) AND (`classSchedule`.`roomID` = `rooms`.`ID`) AND (`classSchedule`.`coursetypeID` = `classTypes`.`ID`)) ORDER BY `classSchedule`.`Date` ASC ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `classSchedule`
--
ALTER TABLE `classSchedule`
  ADD CONSTRAINT `classSchedule_ibfk_1` FOREIGN KEY (`courseID`) REFERENCES `courses` (`ID`),
  ADD CONSTRAINT `classSchedule_ibfk_2` FOREIGN KEY (`coursetypeID`) REFERENCES `classTypes` (`ID`),
  ADD CONSTRAINT `classSchedule_ibfk_3` FOREIGN KEY (`professorID`) REFERENCES `professors` (`ID`),
  ADD CONSTRAINT `classSchedule_ibfk_4` FOREIGN KEY (`roomID`) REFERENCES `rooms` (`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 */;
