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

START TRANSACTION;



--
-- Database: `samaksha_schedule`
--

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

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

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

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

INSERT INTO `classes` (`class_id`, `class`) VALUES
(1, 'ACAD324: The Practice of Design'),
(2, 'ITP348: Intro to Physical Computing'),
(3, 'ACAD276: Dev 2'),
(4, 'ACAD240: Materials'),
(5, 'ITP216: Applied Python');

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

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

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

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

INSERT INTO `locations` (`location_id`, `location`) VALUES
(1, 'IYH210'),
(2, 'IYH 212/213'),
(3, 'GFS 101'),
(4, 'Zoom');

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

--
-- Table structure for table `main_schedule`
--

CREATE TABLE `main_schedule` (
  `main_schedule_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `class_id` int(11) NOT NULL,
  `start_time` varchar(20) NOT NULL,
  `end_time` varchar(20) NOT NULL,
  `location_id` int(11) NOT NULL,
  `type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `main_schedule`
--

INSERT INTO `main_schedule` (`main_schedule_id`, `date`, `class_id`, `start_time`, `end_time`, `location_id`, `type_id`) VALUES
(1, '2023-09-11', 1, '9:00', '11:50am', 2, 1),
(2, '2023-09-11', 2, '12:00pm', '1:50pm', 4, 3),
(3, '2023-09-12', 3, '2:00pm', '4:50pm', 1, 3),
(4, '2023-09-12', 4, '6:00pm', '7:50pm', 2, 3),
(5, '2023-09-13', 1, '9:00', '11:50am', 2, 1),
(6, '2023-09-13', 2, '12:00pm', '1:50pm', 4, 3),
(7, '2023-09-13', 5, '6:00pm', '7:50pm', 3, 3),
(8, '2023-09-14', 3, '2:00pm', '4:50pm', 1, 3),
(9, '2023-09-14', 4, '6:00pm', '7:50pm', 2, 3),
(10, '2023-09-18', 1, '9:00', '11:50am', 2, 1),
(11, '2023-09-18', 2, '12:00pm', '1:50pm', 4, 3),
(12, '2023-09-19', 3, '2:00pm', '4:50pm', 1, 3),
(13, '2023-09-19', 4, '6:00pm', '7:50pm', 2, 3),
(14, '2023-09-20', 1, '9:00', '11:50am', 2, 1),
(15, '2023-09-20', 2, '12:00pm', '1:50pm', 4, 3),
(16, '2023-09-20', 5, '6:00pm', '7:50pm', 3, 3),
(17, '2023-09-21', 2, '12:00pm', '1:50pm', 4, 3),
(18, '2023-09-21', 4, '6:00pm', '7:50pm', 2, 3),
(19, '2023-09-25', 1, '9:00', '11:50am', 2, 1),
(20, '2023-09-25', 2, '12:00pm', '1:50pm', 4, 3),
(21, '2023-09-26', 3, '2:00pm', '4:50pm', 1, 3),
(22, '2023-09-26', 4, '6:00pm', '7:50pm', 2, 3),
(23, '2023-09-27', 1, '9:00', '11:50am', 2, 1),
(24, '2023-09-27', 2, '12:00pm', '1:50pm', 4, 3),
(25, '2023-09-27', 5, '6:00pm', '7:50pm', 3, 3),
(26, '2023-09-28', 3, '2:00pm', '4:50pm', 1, 3),
(27, '2023-09-28', 4, '6:00pm', '7:50pm', 2, 3),
(30, '2023-10-02', 1, '9:00', '11:50am', 2, 1),
(31, '2023-10-02', 2, '12:00pm', '1:50pm', 4, 3),
(32, '2023-10-03', 3, '2:00pm', '4:50pm', 1, 3),
(33, '2023-10-03', 4, '6:00pm', '7:50pm', 2, 3),
(34, '2023-10-04', 1, '9:00', '11:50am', 2, 1),
(35, '2023-10-04', 2, '12:00pm', '1:50pm', 4, 3),
(36, '2023-10-04', 5, '6:00pm', '7:50pm', 3, 3),
(37, '2023-10-05', 3, '2:00pm', '4:50pm', 1, 3),
(38, '2023-10-05', 4, '6:00pm', '7:50pm', 2, 3);

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

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

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

--
-- Stand-in structure for view `scheduleview2`
-- (See below for the actual view)
--
CREATE TABLE `scheduleview2` (
`class` varchar(35)
,`location` varchar(20)
,`type` varchar(25)
);

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

--
-- Stand-in structure for view `scheduleview3`
-- (See below for the actual view)
--
CREATE TABLE `scheduleview3` (
`date` date
,`class` varchar(35)
,`location` varchar(20)
,`type` varchar(25)
);

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

--
-- 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, 'Lab'),
(3, 'Lecture/Lab');

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`samaksha`@`localhost` SQL SECURITY DEFINER VIEW `scheduleview1`  AS SELECT `main_schedule`.`date` AS `date`, `classes`.`class` AS `class`, `main_schedule`.`start_time` AS `start_time`, `main_schedule`.`end_time` AS `end_time`, `locations`.`location` AS `location`, `types`.`type` AS `type` FROM (((`main_schedule` join `classes`) join `locations`) join `types`) WHERE ((`main_schedule`.`class_id` = `classes`.`class_id`) AND (`main_schedule`.`location_id` = `locations`.`location_id`) AND (`main_schedule`.`type_id` = `types`.`type_id`)) ;

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

--
-- Structure for view `scheduleview2`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`samaksha`@`localhost` SQL SECURITY DEFINER VIEW `scheduleview2`  AS SELECT `classes`.`class` AS `class`, `locations`.`location` AS `location`, `types`.`type` AS `type` FROM (((`main_schedule` join `classes`) join `locations`) join `types`) WHERE ((`main_schedule`.`class_id` = `classes`.`class_id`) AND (`main_schedule`.`location_id` = `locations`.`location_id`) AND (`main_schedule`.`type_id` = `types`.`type_id`)) ;

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

--
-- Structure for view `scheduleview3`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`samaksha`@`localhost` SQL SECURITY DEFINER VIEW `scheduleview3`  AS SELECT `main_schedule`.`date` AS `date`, `classes`.`class` AS `class`, `locations`.`location` AS `location`, `types`.`type` AS `type` FROM (((`main_schedule` join `classes`) join `locations`) join `types`) WHERE ((`main_schedule`.`class_id` = `classes`.`class_id`) AND (`main_schedule`.`location_id` = `locations`.`location_id`) AND (`main_schedule`.`type_id` = `types`.`type_id`)) ;

--
-- Indexes for dumped tables
--

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

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

--
-- Indexes for table `main_schedule`
--
ALTER TABLE `main_schedule`
  ADD PRIMARY KEY (`main_schedule_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `main_schedule`
--
ALTER TABLE `main_schedule`
  MODIFY `main_schedule_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

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

