-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 23, 2026 at 11:08 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: `aalcalde_schedule`
--

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

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

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

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

INSERT INTO `classes` (`class_id`, `course_code`, `class_name`) VALUES
(1, 'TAC 249', 'Introduction to Data Analytics'),
(2, 'ACAD 499', 'Special Topics'),
(3, 'ACAD 376', 'Industry Practicum I: Designing and Implementing Real-World Solutions'),
(4, 'TAC 216', 'Applied Python'),
(5, 'ACAD 276', 'Dev II');

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

--
-- Table structure for table `class_meetings`
--

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

--
-- Dumping data for table `class_meetings`
--

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

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

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

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

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

INSERT INTO `locations` (`location_id`, `location_name`) VALUES
(1, 'GFS118'),
(2, 'ZHS163'),
(3, 'THH202'),
(4, 'KAP160'),
(5, 'IYH210/211');

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

--
-- Table structure for table `meeting_types`
--

CREATE TABLE `meeting_types` (
  `type_id` int(11) NOT NULL,
  `type_name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `meeting_types`
--

INSERT INTO `meeting_types` (`type_id`, `type_name`) VALUES
(1, 'Lecture'),
(2, 'Lab'),
(3, 'Lab/Lecture');

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

--
-- Stand-in structure for view `schedule_view`
-- (See below for the actual view)
--
CREATE TABLE `schedule_view` (
`Date` date
,`Start Time` time
,`End Time` time
,`Course` varchar(20)
,`Class Name` varchar(150)
,`Location` varchar(50)
,`Type` varchar(30)
);

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

--
-- Stand-in structure for view `schedule_view_ids`
-- (See below for the actual view)
--
CREATE TABLE `schedule_view_ids` (
`meeting_id` int(11)
,`class_id` int(11)
,`location_id` int(11)
,`type_id` int(11)
,`Date` date
,`Start Time` time
,`End Time` time
,`Course` varchar(20)
,`Class Name` varchar(150)
,`Location` varchar(50)
,`Type` varchar(30)
);

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `class_meetings`
--
ALTER TABLE `class_meetings`
  ADD PRIMARY KEY (`meeting_id`),
  ADD KEY `fk_meeting_class` (`class_id`),
  ADD KEY `fk_meeting_location` (`location_id`),
  ADD KEY `fk_meeting_type` (`type_id`);

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

--
-- Indexes for table `meeting_types`
--
ALTER TABLE `meeting_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 `class_meetings`
--
ALTER TABLE `class_meetings`
  MODIFY `meeting_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

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

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

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`aalcalde`@`localhost` SQL SECURITY DEFINER VIEW `schedule_view`  AS SELECT `cm`.`meeting_date` AS `Date`, `cm`.`start_time` AS `Start Time`, `cm`.`end_time` AS `End Time`, `c`.`course_code` AS `Course`, `c`.`class_name` AS `Class Name`, `l`.`location_name` AS `Location`, `mt`.`type_name` AS `Type` FROM (((`class_meetings` `cm` join `classes` `c` on((`cm`.`class_id` = `c`.`class_id`))) join `locations` `l` on((`cm`.`location_id` = `l`.`location_id`))) join `meeting_types` `mt` on((`cm`.`type_id` = `mt`.`type_id`))) ;

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

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

CREATE ALGORITHM=UNDEFINED DEFINER=`aalcalde`@`localhost` SQL SECURITY DEFINER VIEW `schedule_view_ids`  AS SELECT `class_meetings`.`meeting_id` AS `meeting_id`, `class_meetings`.`class_id` AS `class_id`, `class_meetings`.`location_id` AS `location_id`, `class_meetings`.`type_id` AS `type_id`, `class_meetings`.`meeting_date` AS `Date`, `class_meetings`.`start_time` AS `Start Time`, `class_meetings`.`end_time` AS `End Time`, `classes`.`course_code` AS `Course`, `classes`.`class_name` AS `Class Name`, `locations`.`location_name` AS `Location`, `meeting_types`.`type_name` AS `Type` FROM (((`class_meetings` join `classes` on((`class_meetings`.`class_id` = `classes`.`class_id`))) join `locations` on((`class_meetings`.`location_id` = `locations`.`location_id`))) join `meeting_types` on((`class_meetings`.`type_id` = `meeting_types`.`type_id`))) ;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `class_meetings`
--
ALTER TABLE `class_meetings`
  ADD CONSTRAINT `fk_meeting_class` FOREIGN KEY (`class_id`) REFERENCES `classes` (`class_id`),
  ADD CONSTRAINT `fk_meeting_location` FOREIGN KEY (`location_id`) REFERENCES `locations` (`location_id`),
  ADD CONSTRAINT `fk_meeting_type` FOREIGN KEY (`type_id`) REFERENCES `meeting_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 */;
