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

START TRANSACTION;



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

--
-- 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;

--
-- 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`);

--
-- 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;

--
-- 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;

