-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 17, 2024 at 12:13 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

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: `EES - EMPLOYEE ENGAGEMENT SURVEY`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE `admin` (
  `id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admin`
--

INSERT INTO `admin` (`id`, `username`, `password`, `role`) VALUES
(1, 'ccipkadmin', '$2y$10$2HorLJObO53237kmwVS5WO2VZDb0he2z3NHg0vEeM8Sa6Hx7Rca2m', 'Admin');

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

--
-- Table structure for table `admin_messages`
--

CREATE TABLE `admin_messages` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `text_message` text NOT NULL,
  `admin_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `a_messages`
--

CREATE TABLE `a_messages` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `designation` varchar(255) NOT NULL,
  `text_message` text NOT NULL,
  `company_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `a_questionnaire`
--

CREATE TABLE `a_questionnaire` (
  `id` int(11) NOT NULL,
  `questionnaire` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `designation` varchar(255) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `city` varchar(255) NOT NULL,
  `question_id_1` int(11) NOT NULL,
  `question_1_text` text NOT NULL,
  `selected_answer_1_text` text NOT NULL,
  `rating_1` int(11) NOT NULL,
  `question_id_2` int(11) NOT NULL,
  `question_2_text` text NOT NULL,
  `selected_answer_2_text` text NOT NULL,
  `rating_2` int(11) NOT NULL,
  `question_id_3` int(11) NOT NULL,
  `question_3_text` text NOT NULL,
  `selected_answer_3_text` text NOT NULL,
  `rating_3` int(11) NOT NULL,
  `question_id_4` int(11) NOT NULL,
  `question_4_text` text NOT NULL,
  `selected_answer_4_text` text NOT NULL,
  `rating_4` int(11) NOT NULL,
  `question_id_5` int(11) NOT NULL,
  `question_5_text` text NOT NULL,
  `selected_answer_5_text` text NOT NULL,
  `rating_5` int(11) NOT NULL,
  `question_id_6` int(11) NOT NULL,
  `question_6_text` text NOT NULL,
  `selected_answer_6_text` text NOT NULL,
  `rating_6` int(11) NOT NULL,
  `question_id_7` int(11) NOT NULL,
  `question_7_text` text NOT NULL,
  `selected_answer_7_text` text NOT NULL,
  `rating_7` int(11) NOT NULL,
  `question_id_8` int(11) NOT NULL,
  `question_8_text` text NOT NULL,
  `selected_answer_8_text` text NOT NULL,
  `rating_8` int(11) NOT NULL,
  `question_id_9` int(11) NOT NULL,
  `question_9_text` text NOT NULL,
  `selected_answer_9_text` text NOT NULL,
  `rating_9` int(11) NOT NULL,
  `question_id_10` int(11) NOT NULL,
  `question_10_text` text NOT NULL,
  `selected_answer_10_text` text NOT NULL,
  `rating_10` int(11) NOT NULL,
  `question_id_11` int(11) NOT NULL,
  `question_11_text` text NOT NULL,
  `selected_answer_11_text` text NOT NULL,
  `rating_11` int(11) NOT NULL,
  `question_id_12` int(11) NOT NULL,
  `question_12_text` text NOT NULL,
  `selected_answer_12_text` text NOT NULL,
  `rating_12` int(11) NOT NULL,
  `question_id_13` int(11) NOT NULL,
  `question_13_text` text NOT NULL,
  `selected_answer_13_text` text NOT NULL,
  `rating_13` int(11) NOT NULL,
  `question_id_14` int(11) NOT NULL,
  `question_14_text` text NOT NULL,
  `selected_answer_14_text` text NOT NULL,
  `rating_14` int(11) NOT NULL,
  `question_id_15` int(11) NOT NULL,
  `question_15_text` text NOT NULL,
  `selected_answer_15_text` text NOT NULL,
  `rating_15` int(11) NOT NULL,
  `question_id_16` int(11) NOT NULL,
  `question_16_text` text NOT NULL,
  `selected_answer_16_text` text NOT NULL,
  `rating_16` int(11) NOT NULL,
  `total_rating` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `companies_register`
--

CREATE TABLE `companies_register` (
  `id` int(11) NOT NULL,
  `Name` varchar(255) DEFAULT NULL,
  `Email` varchar(255) DEFAULT NULL,
  `Contact` varchar(255) DEFAULT NULL,
  `Company_name` varchar(255) DEFAULT NULL,
  `Designation` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `company_a`
--

CREATE TABLE `company_a` (
  `id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(255) NOT NULL DEFAULT 'A'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `company_a`
--

INSERT INTO `company_a` (`id`, `username`, `password`, `role`) VALUES
(4, 'companyA', '$2y$10$Xiprxn7njOFgjhx5eWtcVOJP8Ea1gYQO3f1CwDyTK0roYxn58s4GS', 'A');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `admin_messages`
--
ALTER TABLE `admin_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `admin_id` (`admin_id`);

--
-- Indexes for table `a_messages`
--
ALTER TABLE `a_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `company_id` (`company_id`);

--
-- Indexes for table `a_questionnaire`
--
ALTER TABLE `a_questionnaire`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `companies_register`
--
ALTER TABLE `companies_register`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `company_a`
--
ALTER TABLE `company_a`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `admin_messages`
--
ALTER TABLE `admin_messages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `a_questionnaire`
--
ALTER TABLE `a_questionnaire`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `companies_register`
--
ALTER TABLE `companies_register`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `admin_messages`
--
ALTER TABLE `admin_messages`
  ADD CONSTRAINT `admin_messages_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `admin` (`id`);

--
-- Constraints for table `a_messages`
--
ALTER TABLE `a_messages`
  ADD CONSTRAINT `a_messages_ibfk_1` FOREIGN KEY (`company_id`) REFERENCES `company_a` (`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 */;
