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

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

--
-- Stand-in structure for view `classSchedule`
-- (See below for the actual view)
--
CREATE TABLE `classSchedule` (
`class_id` int(11)
,`date` date
,`start_time` time
,`end_time` time
,`location` varchar(10)
,`type` varchar(25)
,`class_name` varchar(50)
);

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

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

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

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

INSERT INTO `locations` (`location_id`, `location`) VALUES
(1, 'THH108'),
(2, 'GFS109'),
(3, 'IYH210/211'),
(4, 'ONLINE');

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

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

CREATE TABLE `schedule` (
  `class_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,
  `type_id` int(11) NOT NULL,
  `class_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `schedule` (`class_id`, `date`, `start_time`, `end_time`, `location_id`, `type_id`, `class_name`) VALUES
(1, '2026-09-14', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(2, '2026-09-15', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(3, '2026-09-15', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(4, '2026-09-16', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(5, '2026-09-16', '19:00:00', '21:50:00', 4, 1, 'IDSN 523: Product Design for User Experience'),
(6, '2026-09-17', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(7, '2026-09-17', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(8, '2026-09-21', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(9, '2026-09-22', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(10, '2026-09-22', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(11, '2026-09-23', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(12, '2026-09-23', '19:00:00', '21:50:00', 4, 1, 'IDSN 523: Product Design for User Experience'),
(13, '2026-09-24', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(14, '2026-09-24', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(15, '2026-09-28', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(16, '2026-09-29', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(17, '2026-09-29', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(18, '2026-09-30', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(19, '2026-09-30', '19:00:00', '21:50:00', 4, 1, 'IDSN 523: Product Design for User Experience'),
(20, '2026-10-01', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(21, '2026-10-01', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(22, '2026-10-05', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(23, '2026-10-06', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(24, '2026-10-06', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II'),
(25, '2026-10-07', '10:00:00', '11:20:00', 1, 1, 'SLL345: Literature and Philosophy: Dostoevsky'),
(26, '2026-10-07', '19:00:00', '21:50:00', 4, 1, 'IDSN 523: Product Design for User Experience'),
(27, '2026-10-08', '09:30:00', '10:50:00', 2, 1, 'WRIT 340: Advanced Writing and Critical Engagement'),
(28, '2026-10-08', '12:00:00', '13:50:00', 3, 2, 'ACAD 276: Dev II');

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

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

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

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

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

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `schedule`
--
ALTER TABLE `schedule`
  ADD PRIMARY KEY (`class_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `type_id` (`type_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`jaehoonk`@`localhost` SQL SECURITY DEFINER VIEW `classSchedule`  AS SELECT `schedule`.`class_id` AS `class_id`, `schedule`.`date` AS `date`, `schedule`.`start_time` AS `start_time`, `schedule`.`end_time` AS `end_time`, `locations`.`location` AS `location`, `types`.`type` AS `type`, `schedule`.`class_name` AS `class_name` FROM ((`schedule` join `locations`) join `types`) WHERE ((`locations`.`location_id` = `schedule`.`location_id`) AND (`types`.`type_id` = `schedule`.`type_id`)) ORDER BY `schedule`.`date` ASC, `schedule`.`start_time` ASC ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `schedule`
--
ALTER TABLE `schedule`
  ADD CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`),
  ADD CONSTRAINT `schedule_ibfk_2` FOREIGN KEY (`type_id`) REFERENCES `types` (`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 */;
