-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 11, 2019 at 02:22 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `int__opt_db`
--

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

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

CREATE TABLE `admin` (
  `admin_id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `applicant`
--

CREATE TABLE `applicant` (
  `applicant_id` int(11) NOT NULL,
  `takeDate` date NOT NULL,
  `result` varchar(20) NOT NULL,
  `firstname` varchar(30) NOT NULL,
  `lastname` varchar(30) NOT NULL,
  `type` varchar(20) NOT NULL,
  `address` varchar(50) NOT NULL,
  `contact` varchar(30) NOT NULL,
  `position` varchar(50) NOT NULL,
  `civilStatus` varchar(20) NOT NULL,
  `lenghtOfService` varchar(30) NOT NULL,
  `field` varchar(50) NOT NULL,
  `age` int(11) NOT NULL,
  `gender` varchar(11) NOT NULL,
  `email` varchar(30) NOT NULL,
  `password` varchar(20) NOT NULL,
  `username` varchar(30) NOT NULL,
  `discStatus` varchar(20) NOT NULL,
  `ssctStatus` varchar(20) NOT NULL,
  `tempStatus` varchar(20) NOT NULL,
  `careStatus` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `asses_tbl`
--

CREATE TABLE `asses_tbl` (
  `assId` int(11) NOT NULL,
  `applicant_id` int(11) NOT NULL,
  `applicant_name` varchar(20) NOT NULL,
  `ssct_id` int(11) NOT NULL,
  `que` varchar(40) NOT NULL,
  `assessment` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `care_ans`
--

CREATE TABLE `care_ans` (
  `careans_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `care_id` int(11) NOT NULL,
  `rank1` int(11) NOT NULL,
  `rank2` int(11) NOT NULL,
  `rank3` int(11) NOT NULL,
  `rank4` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `care_ques`
--

CREATE TABLE `care_ques` (
  `care_id` int(11) NOT NULL,
  `set` varchar(11) NOT NULL,
  `choicea` text NOT NULL,
  `choiceb` text NOT NULL,
  `choicec` text NOT NULL,
  `choiced` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `disc_ans`
--

CREATE TABLE `disc_ans` (
  `discans_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `answer` varchar(50) NOT NULL,
  `answerWord` varchar(30) NOT NULL,
  `kind` varchar(20) NOT NULL,
  `disc_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `disc_ques`
--

CREATE TABLE `disc_ques` (
  `disc_id` int(11) NOT NULL,
  `kind` varchar(15) NOT NULL,
  `set` varchar(11) NOT NULL,
  `a` text NOT NULL,
  `b` text NOT NULL,
  `c` text NOT NULL,
  `d` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ssct_ans`
--

CREATE TABLE `ssct_ans` (
  `ssctans_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `answer` text NOT NULL,
  `ssct_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ssct_ques`
--

CREATE TABLE `ssct_ques` (
  `ssct_id` int(11) NOT NULL,
  `question` text NOT NULL,
  `group` int(11) NOT NULL,
  `item` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `temp_ans`
--

CREATE TABLE `temp_ans` (
  `temp_ans` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `setexam` varchar(10) NOT NULL,
  `answer` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `temp_ques`
--

CREATE TABLE `temp_ques` (
  `tempques_id` int(11) NOT NULL,
  `seta` text NOT NULL,
  `setb` text NOT NULL,
  `setc` text NOT NULL,
  `setd` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `applicant`
--
ALTER TABLE `applicant`
  ADD PRIMARY KEY (`applicant_id`);

--
-- Indexes for table `asses_tbl`
--
ALTER TABLE `asses_tbl`
  ADD PRIMARY KEY (`assId`),
  ADD KEY `applicant_id` (`applicant_id`);

--
-- Indexes for table `care_ans`
--
ALTER TABLE `care_ans`
  ADD PRIMARY KEY (`careans_id`),
  ADD KEY `care_id` (`care_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `care_ques`
--
ALTER TABLE `care_ques`
  ADD PRIMARY KEY (`care_id`);

--
-- Indexes for table `disc_ans`
--
ALTER TABLE `disc_ans`
  ADD PRIMARY KEY (`discans_id`),
  ADD KEY `disc_id` (`disc_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `disc_ques`
--
ALTER TABLE `disc_ques`
  ADD PRIMARY KEY (`disc_id`);

--
-- Indexes for table `ssct_ans`
--
ALTER TABLE `ssct_ans`
  ADD PRIMARY KEY (`ssctans_id`),
  ADD KEY `ssct_id` (`ssct_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `ssct_ques`
--
ALTER TABLE `ssct_ques`
  ADD PRIMARY KEY (`ssct_id`);

--
-- Indexes for table `temp_ans`
--
ALTER TABLE `temp_ans`
  ADD PRIMARY KEY (`temp_ans`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `temp_ques`
--
ALTER TABLE `temp_ques`
  ADD PRIMARY KEY (`tempques_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
  MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `applicant`
--
ALTER TABLE `applicant`
  MODIFY `applicant_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `asses_tbl`
--
ALTER TABLE `asses_tbl`
  MODIFY `assId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `care_ans`
--
ALTER TABLE `care_ans`
  MODIFY `careans_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `care_ques`
--
ALTER TABLE `care_ques`
  MODIFY `care_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `disc_ans`
--
ALTER TABLE `disc_ans`
  MODIFY `discans_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `disc_ques`
--
ALTER TABLE `disc_ques`
  MODIFY `disc_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ssct_ans`
--
ALTER TABLE `ssct_ans`
  MODIFY `ssctans_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ssct_ques`
--
ALTER TABLE `ssct_ques`
  MODIFY `ssct_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `temp_ans`
--
ALTER TABLE `temp_ans`
  MODIFY `temp_ans` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `temp_ques`
--
ALTER TABLE `temp_ques`
  MODIFY `tempques_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `care_ans`
--
ALTER TABLE `care_ans`
  ADD CONSTRAINT `care_ans_ibfk_1` FOREIGN KEY (`care_id`) REFERENCES `care_ques` (`care_id`),
  ADD CONSTRAINT `care_ans_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `applicant` (`applicant_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `disc_ans`
--
ALTER TABLE `disc_ans`
  ADD CONSTRAINT `disc_ans_ibfk_1` FOREIGN KEY (`disc_id`) REFERENCES `disc_ques` (`disc_id`),
  ADD CONSTRAINT `disc_ans_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `applicant` (`applicant_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `ssct_ans`
--
ALTER TABLE `ssct_ans`
  ADD CONSTRAINT `ssct_ans_ibfk_1` FOREIGN KEY (`ssct_id`) REFERENCES `ssct_ques` (`ssct_id`),
  ADD CONSTRAINT `ssct_ans_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `applicant` (`applicant_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `temp_ans`
--
ALTER TABLE `temp_ans`
  ADD CONSTRAINT `temp_ans_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `applicant` (`applicant_id`) ON DELETE CASCADE ON UPDATE CASCADE;

/*!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 */;
