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

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

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

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

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

INSERT INTO `classes` (`class_id`, `class`) VALUES
                                                (1, 'WRIT 340: Critical Engagement for Pre Law'),
                                                (2, 'ACAD 276: Dev II'),
                                                (3, 'ACAD 444: Designing Products for Industry'),
                                                (4, 'ACAD 376: Industry Practicum I');

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

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

CREATE TABLE `class_schedule` (
                                  `meeting_id` int(11) NOT NULL,
                                  `date` date NOT NULL,
                                  `start_time_id` int(5) NOT NULL,
                                  `end_time_id` int(5) NOT NULL,
                                  `location_id` int(5) NOT NULL,
                                  `class_type_id` int(5) NOT NULL,
                                  `class_id` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `class_schedule` (`meeting_id`, `date`, `start_time_id`, `end_time_id`, `location_id`, `class_type_id`, `class_id`) VALUES
                                                                                                                                    (1, '2026-09-14', 1, 1, 1, 1, 1),
                                                                                                                                    (2, '2026-09-15', 2, 2, 2, 1, 2),
                                                                                                                                    (3, '2026-09-15', 3, 3, 3, 1, 3),
                                                                                                                                    (4, '2026-09-16', 1, 1, 1, 1, 1),
                                                                                                                                    (5, '2026-09-16', 2, 2, 4, 1, 4),
                                                                                                                                    (6, '2026-09-17', 2, 2, 2, 1, 2),
                                                                                                                                    (7, '2026-09-18', 1, 1, 1, 1, 1),
                                                                                                                                    (8, '2026-09-18', 2, 2, 4, 1, 4),
                                                                                                                                    (9, '2026-09-21', 1, 1, 1, 1, 1),
                                                                                                                                    (10, '2026-09-22', 2, 2, 2, 1, 2),
                                                                                                                                    (11, '2026-09-22', 3, 3, 3, 1, 3),
                                                                                                                                    (12, '2026-09-23', 1, 1, 1, 1, 1),
                                                                                                                                    (13, '2026-09-23', 2, 2, 4, 1, 4),
                                                                                                                                    (14, '2026-09-24', 2, 2, 2, 1, 2),
                                                                                                                                    (15, '2026-09-25', 1, 1, 1, 1, 1),
                                                                                                                                    (16, '2026-09-25', 2, 2, 4, 1, 4),
                                                                                                                                    (17, '2026-09-28', 1, 1, 1, 1, 1),
                                                                                                                                    (18, '2026-09-29', 2, 2, 2, 1, 2),
                                                                                                                                    (19, '2026-09-29', 3, 3, 3, 1, 3),
                                                                                                                                    (20, '2026-09-30', 1, 1, 1, 1, 1),
                                                                                                                                    (21, '2026-09-30', 2, 2, 4, 1, 4),
                                                                                                                                    (22, '2026-10-01', 2, 2, 2, 1, 2),
                                                                                                                                    (23, '2026-10-02', 1, 1, 1, 1, 1),
                                                                                                                                    (24, '2026-10-02', 2, 2, 4, 1, 4),
                                                                                                                                    (25, '2026-10-05', 1, 1, 1, 1, 1),
                                                                                                                                    (26, '2026-10-06', 2, 2, 2, 1, 2),
                                                                                                                                    (27, '2026-10-06', 3, 3, 3, 1, 3),
                                                                                                                                    (28, '2026-10-07', 1, 1, 1, 1, 1),
                                                                                                                                    (29, '2026-10-07', 2, 2, 4, 1, 4),
                                                                                                                                    (30, '2026-10-08', 2, 2, 2, 1, 2),
                                                                                                                                    (31, '2026-10-09', 1, 1, 1, 1, 1),
                                                                                                                                    (32, '2026-10-09', 2, 2, 4, 1, 4);

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

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

CREATE TABLE `class_types` (
                               `class_type_id` int(5) NOT NULL,
                               `class_type` varchar(25) 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');

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

--
-- Table structure for table `end_times`
--

CREATE TABLE `end_times` (
                             `end_time_id` int(5) NOT NULL,
                             `end_time` time(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `end_times`
--

INSERT INTO `end_times` (`end_time_id`, `end_time`) VALUES
                                                        (1, '11:50:00.000000'),
                                                        (2, '13:50:00.000000'),
                                                        (3, '17:20:00.000000');

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

--
-- Stand-in structure for view `hw3A_view`
-- (See below for the actual view)
--
CREATE TABLE `hw3A_view` (
                             `date` date
    ,`start_time` time(6)
    ,`end_time` time(6)
    ,`location` varchar(25)
    ,`class_type` varchar(25)
    ,`class` varchar(50)
    ,`class_id` int(5)
    ,`meeting_id` int(11)
);

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

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

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

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

INSERT INTO `locations` (`location_id`, `location`) VALUES
                                                        (1, 'GFS 220'),
                                                        (2, 'IYH 210/211'),
                                                        (3, 'IYH 212/213'),
                                                        (4, 'THH 202');

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

--
-- Table structure for table `start_times`
--

CREATE TABLE `start_times` (
                               `start_time_id` int(5) NOT NULL,
                               `start_time` time(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `start_times`
--

INSERT INTO `start_times` (`start_time_id`, `start_time`) VALUES
                                                              (1, '11:00:00.000000'),
                                                              (2, '12:00:00.000000'),
                                                              (3, '14:00:00.000000');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `class_schedule`
--
ALTER TABLE `class_schedule`
    ADD PRIMARY KEY (`meeting_id`),
  ADD KEY `class_id` (`class_id`),
  ADD KEY `class_type_id` (`class_type_id`),
  ADD KEY `end_time_id` (`end_time_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `start_time_id` (`start_time_id`);

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

--
-- Indexes for table `end_times`
--
ALTER TABLE `end_times`
    ADD PRIMARY KEY (`end_time_id`);

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

--
-- Indexes for table `start_times`
--
ALTER TABLE `start_times`
    ADD PRIMARY KEY (`start_time_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

--
-- AUTO_INCREMENT for table `end_times`
--
ALTER TABLE `end_times`
    MODIFY `end_time_id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

--
-- AUTO_INCREMENT for table `start_times`
--
ALTER TABLE `start_times`
    MODIFY `start_time_id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`zcgreen`@`localhost` SQL SECURITY DEFINER VIEW `hw3A_view`  AS SELECT `class_schedule`.`date` AS `date`, `start_times`.`start_time` AS `start_time`, `end_times`.`end_time` AS `end_time`, `locations`.`location` AS `location`, `class_types`.`class_type` AS `class_type`, `classes`.`class` AS `class`, `classes`.`class_id` AS `class_id`, `class_schedule`.`meeting_id` AS `meeting_id` FROM (((((`class_schedule` join `start_times`) join `end_times`) join `locations`) join `class_types`) join `classes`) WHERE ((`start_times`.`start_time_id` = `class_schedule`.`start_time_id`) AND (`end_times`.`end_time_id` = `class_schedule`.`end_time_id`) AND (`locations`.`location_id` = `class_schedule`.`location_id`) AND (`class_types`.`class_type_id` = `class_schedule`.`class_type_id`) AND (`classes`.`class_id` = `class_schedule`.`class_id`)) ORDER BY `class_schedule`.`date` ASC ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `class_schedule`
--
ALTER TABLE `class_schedule`
    ADD CONSTRAINT `class_schedule_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `classes` (`class_id`),
  ADD CONSTRAINT `class_schedule_ibfk_2` FOREIGN KEY (`class_type_id`) REFERENCES `class_types` (`class_type_id`),
  ADD CONSTRAINT `class_schedule_ibfk_3` FOREIGN KEY (`end_time_id`) REFERENCES `end_times` (`end_time_id`),
  ADD CONSTRAINT `class_schedule_ibfk_4` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`),
  ADD CONSTRAINT `class_schedule_ibfk_5` FOREIGN KEY (`start_time_id`) REFERENCES `start_times` (`start_time_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 */;
