-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `juraboev_schedule`
--

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

--
-- Table structure for table `class_schedule`
--

CREATE TABLE `class_schedule` (
  `class_scheduleID` int(11) NOT NULL,
  `date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `locationID` int(11) NOT NULL,
  `typeID` int(11) NOT NULL,
  `nameID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `class_schedule`
--

INSERT INTO `class_schedule` (`class_scheduleID`, `date`, `start_time`, `end_time`, `locationID`, `typeID`, `nameID`) VALUES
(16, '2023-09-11', '09:00:00', '11:50:00', 1, 1, 1),
(17, '2023-09-11', '13:00:00', '15:50:00', 2, 1, 2),
(18, '2023-09-12', '12:00:00', '13:50:00', 3, 1, 3),
(19, '2023-09-12', '14:00:00', '16:50:00', 4, 1, 4),
(20, '2023-09-12', '18:00:00', '19:50:00', 1, 1, 5),
(21, '2023-09-13', '09:00:00', '11:50:00', 1, 1, 1),
(22, '2023-09-13', '14:00:00', '17:50:00', 5, 1, 6),
(23, '2023-09-14', '13:00:00', '13:50:00', 6, 2, 6),
(24, '2023-09-14', '14:00:00', '16:50:00', 4, 1, 4),
(25, '2023-09-14', '18:00:00', '19:50:00', 1, 1, 5),
(46, '2023-09-18', '09:00:00', '11:50:00', 1, 1, 1),
(47, '2023-09-18', '13:00:00', '15:50:00', 2, 1, 2),
(48, '2023-09-19', '12:00:00', '13:50:00', 3, 1, 3),
(49, '2023-09-19', '14:00:00', '16:50:00', 4, 1, 4),
(50, '2023-09-19', '18:00:00', '19:50:00', 1, 1, 5),
(51, '2023-09-20', '09:00:00', '11:50:00', 1, 1, 1),
(52, '2023-09-20', '14:00:00', '17:50:00', 5, 1, 6),
(53, '2023-09-21', '13:00:00', '13:50:00', 6, 2, 6),
(54, '2023-09-21', '14:00:00', '16:50:00', 4, 1, 4),
(55, '2023-09-21', '18:00:00', '19:50:00', 1, 1, 5),
(66, '2023-09-25', '09:00:00', '11:50:00', 1, 1, 1),
(67, '2023-09-25', '13:00:00', '15:50:00', 2, 1, 2),
(68, '2023-09-26', '12:00:00', '13:50:00', 3, 1, 3),
(69, '2023-09-26', '14:00:00', '16:50:00', 4, 1, 4),
(70, '2023-09-26', '18:00:00', '19:50:00', 1, 1, 5),
(71, '2023-09-27', '09:00:00', '11:50:00', 1, 1, 1),
(72, '2023-09-27', '14:00:00', '17:50:00', 5, 1, 6),
(73, '2023-09-28', '13:00:00', '13:50:00', 6, 2, 6),
(74, '2023-09-28', '14:00:00', '16:50:00', 4, 1, 4),
(75, '2023-09-28', '18:00:00', '19:50:00', 1, 1, 5),
(76, '2023-10-02', '09:00:00', '11:50:00', 1, 1, 1),
(77, '2023-10-02', '13:00:00', '15:50:00', 2, 1, 2),
(78, '2023-10-03', '12:00:00', '13:50:00', 3, 1, 3),
(79, '2023-10-03', '14:00:00', '16:50:00', 4, 1, 4),
(80, '2023-10-03', '18:00:00', '19:50:00', 1, 1, 5),
(81, '2023-10-04', '09:00:00', '11:50:00', 1, 1, 1),
(82, '2023-10-04', '14:00:00', '17:50:00', 5, 1, 6),
(83, '2023-10-05', '13:00:00', '13:50:00', 6, 2, 6),
(84, '2023-10-05', '14:00:00', '16:50:00', 4, 1, 4),
(85, '2023-10-05', '18:00:00', '19:50:00', 1, 1, 5);

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

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

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

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

INSERT INTO `locations` (`locationID`, `location`) VALUES
(1, 'IYH212/213'),
(2, 'RZC111'),
(3, 'GFS118'),
(4, 'IYH210/211'),
(5, 'NCT'),
(6, 'SCA203');

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

--
-- Table structure for table `names`
--

CREATE TABLE `names` (
  `nameID` int(11) NOT NULL,
  `name` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `names`
--

INSERT INTO `names` (`nameID`, `name`) VALUES
(1, 'ACAD 324: POD'),
(2, 'TAN 451: Animation'),
(3, 'IP 115: Python'),
(4, 'ACAD 276: Dev Il'),
(5, 'ACAD 240: Materials'),
(6, 'CCS 190: Intro to Cinema');

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

--
-- Stand-in structure for view `scheduleview1`
-- (See below for the actual view)
--
CREATE TABLE `scheduleview1` (
`date` date
,`end_time` time
,`start_time` time
,`location` varchar(25)
,`type` varchar(25)
,`name` varchar(25)
);

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

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

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

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

INSERT INTO `types` (`typeID`, `type`) VALUES
(1, 'Lecture'),
(2, 'Discussion');

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

--
-- Structure for view `scheduleview1`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`juraboev`@`localhost` SQL SECURITY DEFINER VIEW `scheduleview1`  AS SELECT `class_schedule`.`date` AS `date`, `class_schedule`.`end_time` AS `end_time`, `class_schedule`.`start_time` AS `start_time`, `locations`.`location` AS `location`, `types`.`type` AS `type`, `names`.`name` AS `name` FROM (((`class_schedule` join `locations`) join `types`) join `names`) WHERE ((`class_schedule`.`locationID` = `locations`.`locationID`) AND (`class_schedule`.`typeID` = `types`.`typeID`) AND (`class_schedule`.`nameID` = `names`.`nameID`)) ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `class_schedule`
--
ALTER TABLE `class_schedule`
  ADD PRIMARY KEY (`class_scheduleID`);

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

--
-- Indexes for table `names`
--
ALTER TABLE `names`
  ADD PRIMARY KEY (`nameID`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `class_schedule`
--
ALTER TABLE `class_schedule`
  MODIFY `class_scheduleID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=86;

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

--
-- AUTO_INCREMENT for table `names`
--
ALTER TABLE `names`
  MODIFY `nameID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

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

