-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 03, 2025 at 03:20 PM
-- Server version: 8.3.0
-- PHP Version: 8.3.6

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: `utme_db`
--

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

--
-- Table structure for table `applications`
--

DROP TABLE IF EXISTS `applications`;
CREATE TABLE IF NOT EXISTS `applications` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int UNSIGNED NOT NULL,
  `application_no` varchar(50) NOT NULL,
  `rrr` varchar(255) DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `submission_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(20) DEFAULT 'submitted',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `education_details`
--

DROP TABLE IF EXISTS `education_details`;
CREATE TABLE IF NOT EXISTS `education_details` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int UNSIGNED NOT NULL,
  `institution_name` varchar(100) NOT NULL,
  `qualification` varchar(50) NOT NULL,
  `from_date` date DEFAULT NULL,
  `to_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `education_details_ibfk_1` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `olevel_results`
--

DROP TABLE IF EXISTS `olevel_results`;
CREATE TABLE IF NOT EXISTS `olevel_results` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int UNSIGNED NOT NULL,
  `sitting` int NOT NULL,
  `year` varchar(4) DEFAULT NULL,
  `exam_body` varchar(10) DEFAULT NULL,
  `exam_type` varchar(10) DEFAULT NULL,
  `exam_no` varchar(20) DEFAULT NULL,
  `math_grade` varchar(2) DEFAULT NULL,
  `english_grade` varchar(2) DEFAULT NULL,
  `biology_grade` varchar(2) DEFAULT NULL,
  `chemistry_grade` varchar(2) DEFAULT NULL,
  `physics_grade` varchar(2) DEFAULT NULL,
  `geography_grade` varchar(2) DEFAULT NULL,
  `economics_grade` varchar(2) DEFAULT NULL,
  `government_grade` varchar(2) DEFAULT NULL,
  `literature_grade` varchar(2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `password_resets`
--

DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE IF NOT EXISTS `password_resets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `firstname` varchar(30) NOT NULL,
  `lastname` varchar(30) NOT NULL,
  `othername` varchar(30) DEFAULT NULL,
  `gender` varchar(10) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `disability` varchar(255) DEFAULT NULL,
  `placeOfBirth` varchar(255) DEFAULT NULL,
  `stateOfOrigin` varchar(255) DEFAULT NULL,
  `lga` varchar(255) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `phonenumber` varchar(20) DEFAULT NULL,
  `homeAddress` text,
  `nextOfKinName` varchar(100) DEFAULT NULL,
  `nextOfKinGsm` varchar(20) DEFAULT NULL,
  `nextOfKinAddress` text,
  `sponsorName` varchar(100) DEFAULT NULL,
  `sponsorAddress` text,
  `jambnumber` varchar(20) DEFAULT NULL,
  `jambscore` int DEFAULT NULL,
  `school` varchar(10) NOT NULL,
  `programme` varchar(50) DEFAULT NULL,
  `session` varchar(10) DEFAULT NULL,
  `passport_photo` varchar(255) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `reg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `applications`
--
ALTER TABLE `applications`
  ADD CONSTRAINT `applications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `olevel_results`
--
ALTER TABLE `olevel_results`
  ADD CONSTRAINT `olevel_results_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 */;
