-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 06, 2026 at 09:44 AM
-- 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: `saadia_schedule`
--

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

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

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

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

INSERT INTO `classes` (`class_id`, `class_name`) VALUES
(1, 'ACAD 276: Dev II'),
(2, 'DANC 342: Intl & Historical Perspectives on Dance'),
(3, 'ACAD 376: Industry Practicum I'),
(4, 'ACAD 499: Special Topics - Understanding AI');

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

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

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

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

INSERT INTO `class_types` (`class_type_id`, `class_type`) VALUES
(1, 'Lecture'),
(2, 'Lab'),
(3, 'Lecture/Lab');

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

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

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

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

INSERT INTO `locations` (`location_id`, `location`) VALUES
(1, 'IYH210/211'),
(2, 'KDC235'),
(3, 'THH202'),
(4, 'ZHS163');

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

--
-- Table structure for table `meetings`
--

CREATE TABLE `meetings` (
  `meeting_id` int(11) NOT NULL,
  `meeting_date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `class_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL,
  `class_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `meetings`
--

INSERT INTO `meetings` (`meeting_id`, `meeting_date`, `start_time`, `end_time`, `class_id`, `location_id`, `class_type_id`) VALUES
(1, '2026-08-25', '12:00:00', '13:50:00', 1, 1, 3),
(2, '2026-08-25', '14:00:00', '15:40:00', 2, 2, 1),
(3, '2026-08-26', '12:00:00', '13:50:00', 3, 3, 1),
(4, '2026-08-26', '15:30:00', '18:50:00', 4, 4, 1),
(5, '2026-08-27', '12:00:00', '13:50:00', 1, 1, 3),
(6, '2026-08-27', '14:00:00', '15:40:00', 2, 2, 1),
(7, '2026-08-28', '12:00:00', '13:50:00', 3, 3, 1),
(8, '2026-09-01', '12:00:00', '13:50:00', 1, 1, 3),
(9, '2026-09-01', '14:00:00', '15:40:00', 2, 2, 1),
(10, '2026-09-02', '12:00:00', '13:50:00', 3, 3, 1),
(11, '2026-09-02', '15:30:00', '18:50:00', 4, 4, 1),
(12, '2026-09-03', '12:00:00', '13:50:00', 1, 1, 3),
(13, '2026-09-03', '14:00:00', '15:40:00', 2, 2, 1),
(14, '2026-09-04', '12:00:00', '13:50:00', 3, 3, 1),
(15, '2026-09-08', '12:00:00', '13:50:00', 1, 1, 3),
(16, '2026-09-08', '14:00:00', '15:40:00', 2, 2, 1),
(17, '2026-09-09', '12:00:00', '13:50:00', 3, 3, 1),
(18, '2026-09-09', '15:30:00', '18:50:00', 4, 4, 1),
(19, '2026-09-10', '12:00:00', '13:50:00', 1, 1, 3),
(20, '2026-09-10', '14:00:00', '15:40:00', 2, 2, 1),
(21, '2026-09-11', '12:00:00', '13:50:00', 3, 3, 1),
(22, '2026-09-15', '12:00:00', '13:50:00', 1, 1, 3),
(23, '2026-09-15', '14:00:00', '15:40:00', 2, 2, 1),
(24, '2026-09-16', '12:00:00', '13:50:00', 3, 3, 1),
(25, '2026-09-16', '15:30:00', '18:50:00', 4, 4, 1),
(26, '2026-09-17', '12:00:00', '13:50:00', 1, 1, 3),
(27, '2026-09-17', '14:00:00', '15:40:00', 2, 2, 1),
(28, '2026-09-18', '12:00:00', '13:50:00', 3, 3, 1);

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

--
-- Stand-in structure for view `scheduleView`
-- (See below for the actual view)
--
CREATE TABLE `scheduleView` (
`meeting_date` date
,`start_time` time
,`end_time` time
,`location` varchar(255)
,`class_type` varchar(255)
,`class_name` varchar(255)
);

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

--
-- Stand-in structure for view `scheduleView2`
-- (See below for the actual view)
--
CREATE TABLE `scheduleView2` (
`meeting_id` int(11)
,`meeting_date` date
,`start_time` time
,`end_time` time
,`class_id` int(11)
,`location_id` int(11)
,`class_type_id` int(11)
,`class_name` varchar(255)
,`location` varchar(255)
,`class_type` varchar(255)
);

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indexes for table `meetings`
--
ALTER TABLE `meetings`
  ADD PRIMARY KEY (`meeting_id`),
  ADD KEY `class_id` (`class_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `class_type_id` (`class_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=5;

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

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`saadia`@`localhost` SQL SECURITY DEFINER VIEW `scheduleView`  AS SELECT `meetings`.`meeting_date` AS `meeting_date`, `meetings`.`start_time` AS `start_time`, `meetings`.`end_time` AS `end_time`, `locations`.`location` AS `location`, `class_types`.`class_type` AS `class_type`, `classes`.`class_name` AS `class_name` FROM (((`meetings` join `classes`) join `locations`) join `class_types`) WHERE ((`meetings`.`class_id` = `classes`.`class_id`) AND (`meetings`.`location_id` = `locations`.`location_id`) AND (`meetings`.`class_type_id` = `class_types`.`class_type_id`)) ORDER BY `meetings`.`meeting_date` ASC, `meetings`.`start_time` ASC ;

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`saadia`@`localhost` SQL SECURITY DEFINER VIEW `scheduleView2`  AS SELECT `meetings`.`meeting_id` AS `meeting_id`, `meetings`.`meeting_date` AS `meeting_date`, `meetings`.`start_time` AS `start_time`, `meetings`.`end_time` AS `end_time`, `meetings`.`class_id` AS `class_id`, `meetings`.`location_id` AS `location_id`, `meetings`.`class_type_id` AS `class_type_id`, `classes`.`class_name` AS `class_name`, `locations`.`location` AS `location`, `class_types`.`class_type` AS `class_type` FROM (((`meetings` join `classes`) join `locations`) join `class_types`) WHERE ((`meetings`.`class_id` = `classes`.`class_id`) AND (`meetings`.`location_id` = `locations`.`location_id`) AND (`meetings`.`class_type_id` = `class_types`.`class_type_id`)) ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `meetings`
--
ALTER TABLE `meetings`
  ADD CONSTRAINT `meetings_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `classes` (`class_id`),
  ADD CONSTRAINT `meetings_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`),
  ADD CONSTRAINT `meetings_ibfk_3` FOREIGN KEY (`class_type_id`) REFERENCES `class_types` (`class_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 */;
