-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 24, 2026 at 12:08 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: `heinl_schedule`
--

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

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

CREATE TABLE `classes` (
  `ID` int(11) NOT NULL,
  `class` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `classes` (`ID`, `class`) VALUES
(1, 'ACAD 245: Fundamentals of Product Design'),
(2, 'HIST 266: Business and East Asian Culture, 1800-Present'),
(3, 'CTIN 495: Advanced Themed Entertainment Design'),
(4, 'ACAD 276: Dev II');

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

--
-- Table structure for table `class_types`
--

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

--
-- Dumping data for table `class_types`
--

INSERT INTO `class_types` (`ID`, `class_type`) VALUES
(1, 'lecture'),
(2, 'lab'),
(3, 'lecture/lab');

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

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

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

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

INSERT INTO `locations` (`ID`, `location`) VALUES
(1, 'IYH210/211'),
(2, 'SGM101'),
(3, 'SCIL103'),
(4, 'DMC201');

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

--
-- Table structure for table `schedule`
--

CREATE TABLE `schedule` (
  `ID` int(11) NOT NULL,
  `date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `location_ID` int(11) NOT NULL,
  `class_type_ID` int(11) NOT NULL,
  `class_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `schedule`
--

INSERT INTO `schedule` (`ID`, `date`, `start_time`, `end_time`, `location_ID`, `class_type_ID`, `class_ID`) VALUES
(1, '2026-09-14', '12:00:00', '13:50:00', 1, 3, 1),
(2, '2026-09-14', '15:30:00', '16:50:00', 2, 1, 2),
(3, '2026-09-15', '12:00:00', '13:50:00', 1, 3, 4),
(4, '2026-09-15', '15:00:00', '18:50:00', 3, 3, 3),
(5, '2026-09-16', '12:00:00', '13:50:00', 1, 3, 1),
(6, '2026-09-16', '15:30:00', '16:50:00', 2, 1, 2),
(7, '2026-09-17', '12:00:00', '13:50:00', 1, 3, 4),
(8, '2026-09-18', '11:00:00', '12:50:00', 4, 2, 2),
(9, '2026-09-21', '12:00:00', '13:50:00', 1, 3, 1),
(10, '2026-09-21', '15:30:00', '16:50:00', 2, 1, 2),
(11, '2026-09-22', '12:00:00', '13:50:00', 1, 3, 4),
(12, '2026-09-22', '15:00:00', '18:50:00', 3, 3, 3),
(13, '2026-09-23', '12:00:00', '13:50:00', 1, 3, 1),
(14, '2026-09-23', '15:30:00', '16:50:00', 2, 1, 2),
(15, '2026-09-24', '12:00:00', '13:50:00', 1, 3, 4),
(16, '2026-09-25', '11:00:00', '12:50:00', 4, 2, 2),
(17, '2026-09-28', '12:00:00', '13:50:00', 1, 3, 1),
(18, '2026-09-28', '15:30:00', '16:50:00', 2, 1, 2),
(19, '2026-09-29', '12:00:00', '13:50:00', 1, 3, 4),
(20, '2026-09-29', '15:00:00', '18:50:00', 3, 3, 3),
(21, '2026-09-30', '12:00:00', '13:50:00', 1, 3, 1),
(22, '2026-09-30', '15:30:00', '16:50:00', 2, 1, 2),
(23, '2026-10-01', '12:00:00', '13:50:00', 1, 3, 4),
(24, '2026-10-02', '11:00:00', '12:50:00', 4, 2, 2),
(25, '2026-10-05', '12:00:00', '13:50:00', 1, 3, 1),
(26, '2026-10-05', '15:30:00', '16:50:00', 2, 1, 2),
(27, '2026-10-06', '12:00:00', '13:50:00', 1, 3, 4),
(28, '2026-10-06', '15:00:00', '18:50:00', 3, 3, 3),
(29, '2026-10-07', '12:00:00', '13:50:00', 1, 3, 1),
(30, '2026-10-07', '15:30:00', '16:50:00', 2, 1, 2),
(31, '2026-10-08', '12:00:00', '13:50:00', 1, 3, 4),
(32, '2026-10-09', '11:00:00', '12:50:00', 4, 2, 2);

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

--
-- Stand-in structure for view `schedule_view`
-- (See below for the actual view)
--
CREATE TABLE `schedule_view` (
`date` date
,`start_time` time
,`end_time` time
,`location` varchar(25)
,`class_type` varchar(50)
,`class` varchar(100)
);

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

--
-- Stand-in structure for view `schedule_view_details`
-- (See below for the actual view)
--
CREATE TABLE `schedule_view_details` (
`ID` int(11)
,`date` date
,`start_time` time
,`end_time` time
,`location_ID` int(11)
,`class_type_ID` int(11)
,`class_ID` int(11)
,`class` varchar(100)
,`class_type` varchar(50)
,`location` varchar(25)
);

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indexes for table `schedule`
--
ALTER TABLE `schedule`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `location_key` (`location_ID`),
  ADD KEY `class_type_key` (`class_type_ID`),
  ADD KEY `class_key` (`class_ID`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`heinl`@`localhost` SQL SECURITY DEFINER VIEW `schedule_view`  AS SELECT `schedule`.`date` AS `date`, `schedule`.`start_time` AS `start_time`, `schedule`.`end_time` AS `end_time`, `locations`.`location` AS `location`, `class_types`.`class_type` AS `class_type`, `classes`.`class` AS `class` FROM (((`schedule` join `locations`) join `class_types`) join `classes`) WHERE ((1 = 1) AND (`locations`.`ID` = `schedule`.`location_ID`) AND (`class_types`.`ID` = `schedule`.`class_type_ID`) AND (`classes`.`ID` = `schedule`.`class_ID`)) ;

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`heinl`@`localhost` SQL SECURITY DEFINER VIEW `schedule_view_details`  AS SELECT `schedule`.`ID` AS `ID`, `schedule`.`date` AS `date`, `schedule`.`start_time` AS `start_time`, `schedule`.`end_time` AS `end_time`, `schedule`.`location_ID` AS `location_ID`, `schedule`.`class_type_ID` AS `class_type_ID`, `schedule`.`class_ID` AS `class_ID`, `classes`.`class` AS `class`, `class_types`.`class_type` AS `class_type`, `locations`.`location` AS `location` FROM (((`schedule` join `classes`) join `class_types`) join `locations`) WHERE ((`schedule`.`class_ID` = `classes`.`ID`) AND (`schedule`.`class_type_ID` = `class_types`.`ID`) AND (`schedule`.`location_ID` = `locations`.`ID`)) ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `schedule`
--
ALTER TABLE `schedule`
  ADD CONSTRAINT `class_key` FOREIGN KEY (`class_ID`) REFERENCES `classes` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `class_type_key` FOREIGN KEY (`class_type_ID`) REFERENCES `class_types` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `location_key` FOREIGN KEY (`location_ID`) REFERENCES `locations` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION;
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 */;
