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

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

--
-- Table structure for table `class`
--

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

--
-- Dumping data for table `class`
--

INSERT INTO `class` (`ID`, `class`) VALUES
(1, 'Acad276: Dev 2'),
(2, 'Acad325: Human Technology Interaction and the User Experience'),
(3, 'Acad191: Python for Machine Intelligence'),
(4, 'Hist250: Climate Change: Science, History and Solutions'),
(5, 'Ctin491: Advanced Game Project I');

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

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

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

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

INSERT INTO `locations` (`ID`, `location`) VALUES
(1, 'IYH210/211'),
(2, 'OFFICE'),
(3, 'SOSB2'),
(4, 'WPHB30'),
(5, 'GFS207');

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

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

CREATE TABLE `schedule` (
  `ID` int(11) NOT NULL,
  `Date` date NOT NULL,
  `StartTime` time NOT NULL,
  `EndTime` time NOT NULL,
  `classID` int(11) NOT NULL,
  `locationID` int(11) NOT NULL,
  `typeID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `schedule` (`ID`, `Date`, `StartTime`, `EndTime`, `classID`, `locationID`, `typeID`) VALUES
(1, '2026-08-24', '08:00:00', '09:50:00', 2, 5, 2),
(2, '2026-08-24', '14:00:00', '15:20:00', 4, 3, 2),
(3, '2026-08-25', '12:00:00', '13:50:00', 1, 1, 1),
(4, '2026-08-26', '08:00:00', '09:50:00', 2, 5, 2),
(5, '2026-08-26', '10:00:00', '11:50:00', 3, 1, 1),
(6, '2026-08-26', '14:00:00', '15:20:00', 4, 3, 2),
(7, '2026-08-27', '12:00:00', '13:50:00', 1, 1, 1),
(8, '2026-08-27', '14:00:00', '17:20:00', 5, 2, 1),
(9, '2026-08-28', '10:00:00', '10:50:00', 4, 4, 3),
(10, '2026-08-31', '08:00:00', '09:50:00', 2, 5, 2),
(11, '2026-08-31', '14:00:00', '15:20:00', 4, 3, 2),
(12, '2026-09-01', '12:00:00', '13:50:00', 1, 1, 1),
(13, '2026-09-02', '08:00:00', '09:50:00', 2, 5, 2),
(14, '2026-09-02', '10:00:00', '11:50:00', 3, 1, 1),
(15, '2026-09-02', '14:00:00', '15:20:00', 4, 3, 2),
(16, '2026-09-03', '12:00:00', '13:50:00', 1, 1, 1),
(17, '2026-09-03', '14:00:00', '17:20:00', 5, 2, 1),
(18, '2026-09-04', '10:00:00', '10:50:00', 4, 4, 3),
(19, '2026-09-07', '08:00:00', '09:50:00', 2, 5, 2),
(20, '2026-09-07', '14:00:00', '15:20:00', 4, 3, 2),
(21, '2026-09-08', '12:00:00', '13:50:00', 1, 1, 1),
(22, '2026-09-09', '08:00:00', '09:50:00', 2, 5, 2),
(23, '2026-09-09', '10:00:00', '11:50:00', 3, 1, 1),
(24, '2026-09-09', '14:00:00', '15:20:00', 4, 3, 2),
(25, '2026-09-10', '12:00:00', '13:50:00', 1, 1, 1),
(26, '2026-09-10', '14:00:00', '17:20:00', 5, 2, 1),
(27, '2026-09-11', '10:00:00', '10:50:00', 4, 4, 3),
(28, '2026-09-14', '08:00:00', '09:50:00', 2, 5, 2),
(29, '2026-09-14', '14:00:00', '15:20:00', 4, 3, 2),
(30, '2026-09-15', '12:00:00', '13:50:00', 1, 1, 1),
(31, '2026-09-16', '08:00:00', '09:50:00', 2, 5, 2),
(32, '2026-09-16', '10:00:00', '11:50:00', 3, 1, 1),
(33, '2026-09-16', '14:00:00', '15:20:00', 4, 3, 2),
(34, '2026-09-17', '12:00:00', '13:50:00', 1, 1, 1),
(35, '2026-09-17', '14:00:00', '17:20:00', 5, 2, 1),
(36, '2026-09-18', '10:00:00', '10:50:00', 4, 4, 3);

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

--
-- Stand-in structure for view `schedule_view`
-- (See below for the actual view)
--
CREATE TABLE `schedule_view` (
`ID` int(11)
,`Date` date
,`StartTime` time
,`EndTime` time
,`location` varchar(50)
,`type` varchar(100)
,`class` varchar(100)
);

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

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

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

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

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

--
-- Indexes for dumped tables
--

--
-- Indexes for table `class`
--
ALTER TABLE `class`
  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 `classID` (`classID`),
  ADD KEY `locationID` (`locationID`),
  ADD KEY `typeID` (`typeID`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`luoannab`@`localhost` SQL SECURITY DEFINER VIEW `schedule_view`  AS SELECT `schedule`.`ID` AS `ID`, `schedule`.`Date` AS `Date`, `schedule`.`StartTime` AS `StartTime`, `schedule`.`EndTime` AS `EndTime`, `locations`.`location` AS `location`, `types`.`type` AS `type`, `class`.`class` AS `class` FROM (((`schedule` join `locations` on((`schedule`.`locationID` = `locations`.`ID`))) join `types` on((`schedule`.`typeID` = `types`.`ID`))) join `class` on((`schedule`.`classID` = `class`.`ID`))) ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `schedule`
--
ALTER TABLE `schedule`
  ADD CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`classID`) REFERENCES `class` (`ID`),
  ADD CONSTRAINT `schedule_ibfk_2` FOREIGN KEY (`locationID`) REFERENCES `locations` (`ID`),
  ADD CONSTRAINT `schedule_ibfk_3` FOREIGN KEY (`typeID`) REFERENCES `types` (`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 */;
