-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 07, 2026 at 07:22 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.2.4

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

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

--
-- Table structure for table `cache`
--

CREATE TABLE `cache` (
  `key` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cache_locks`
--

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contact_inquiries`
--

CREATE TABLE `contact_inquiries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contact_inquiries`
--

INSERT INTO `contact_inquiries` (`id`, `name`, `email`, `phone`, `subject`, `message`, `is_read`, `created_at`, `updated_at`) VALUES
(1, 'Harsh', 'harshvermapc5@gmail.com', '987654321', 'testing', 'testing', 1, '2026-06-27 07:44:36', '2026-06-27 07:44:44');

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

--
-- Table structure for table `contests`
--

CREATE TABLE `contests` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `banner` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `category_id` bigint(20) UNSIGNED NOT NULL,
  `entry_fee` decimal(10,2) NOT NULL DEFAULT 0.00,
  `registration_start` datetime NOT NULL,
  `registration_end` datetime NOT NULL,
  `quiz_start_time` datetime NOT NULL,
  `quiz_end_time` datetime NOT NULL,
  `max_participants` int(10) UNSIGNED DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `quiz_status` tinyint(4) NOT NULL DEFAULT 0,
  `rank_generated` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contests`
--

INSERT INTO `contests` (`id`, `title`, `banner`, `description`, `category_id`, `entry_fee`, `registration_start`, `registration_end`, `quiz_start_time`, `quiz_end_time`, `max_participants`, `status`, `quiz_status`, `rank_generated`, `created_at`, `updated_at`) VALUES
(15, 'India General Knowledge Championship 2026', 'contests/ERMAlWeJ6mQR1itwtAwrOXOyh6zKU3oDFOs0bixj.jpg', 'Test your knowledge of India with this exciting General Knowledge Quiz. The contest covers History, Geography, Polity, Science, Sports, Current Affairs, and Indian Culture. Answer all questions within the given time to compete for exciting cash prizes and improve your national ranking.', 3, 100.00, '2026-07-01 14:32:00', '2026-07-01 14:35:00', '2026-07-01 14:36:00', '2026-07-01 15:06:00', 10, 1, 2, 1, '2026-07-01 09:03:16', '2026-07-01 10:35:51'),
(16, 'Tech & Coding Quiz', 'contests/2x2E1lEGQJCm34JXin7ODWuLo4xS3aYV5Eb6lA2w.jpg', 'Questions on programming, AI, web development, databases, and computer fundamentals.', 8, 0.00, '2026-07-01 15:47:00', '2026-07-01 15:50:00', '2026-07-01 15:51:00', '2026-07-01 15:57:00', 2, 1, 2, 1, '2026-07-01 10:18:44', '2026-07-01 11:05:29'),
(17, 'Mixed Mega Quiz', 'contests/G47jwJg0Fzd1aNcDjz8vrlcv0PfcrEjTGs6BvSIN.jpg', 'A combination of GK, science, technology, sports, entertainment, and current affairs.', 7, 0.00, '2026-07-01 16:25:00', '2026-07-01 16:28:00', '2026-07-01 16:30:00', '2026-07-01 16:35:00', 2, 1, 2, 0, '2026-07-01 10:55:44', '2026-07-01 11:02:54'),
(18, 'Friday TEst', 'contests/Y7lPJcIbFGLw8UI8UwdbAHzjSkd22HtyF5NVBk6V.jpg', 'sdxfc', 5, 100.00, '2026-07-03 16:14:00', '2026-07-03 16:16:00', '2026-07-03 16:20:00', '2026-07-03 17:48:00', 34, 1, 2, 0, '2026-07-03 10:44:29', '2026-07-07 05:31:35'),
(19, 'newwww', 'contests/IaxAjSLul6pqlV2NbDf1MFpAq9igv365PX7cvFtE.jpg', 'asdxc', 5, 100.00, '2026-07-03 17:24:00', '2026-07-03 17:33:00', '2026-07-03 18:25:00', '2026-07-03 19:24:00', 34, 1, 2, 0, '2026-07-03 11:54:38', '2026-07-07 05:31:51'),
(20, 'Tuesday Special', 'contests/KjUfotx7OhrjqnXF1cEPL6Q3aFS24LLWgluqGsq6.jpg', 'New contect is here', 8, 200.00, '2026-07-07 11:06:00', '2026-07-07 18:21:00', '2026-07-07 23:11:00', '2026-07-08 00:00:00', 20, 1, 0, 0, '2026-07-07 05:37:07', '2026-07-07 05:37:07'),
(21, 'Wednesday Contest', 'contests/GdPfg9sqDlGMj3Yp522zqmP09iPGUhToIAGGcbju.jpg', 'sfdgfgh', 6, 100.00, '2026-07-08 11:07:00', '2026-07-08 12:07:00', '2026-07-09 12:07:00', '2026-07-09 13:09:00', 45, 1, 0, 0, '2026-07-07 05:38:36', '2026-07-07 05:38:44');

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

--
-- Table structure for table `contest_prizes`
--

CREATE TABLE `contest_prizes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `rank` int(10) UNSIGNED NOT NULL,
  `prize_amount` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contest_prizes`
--

INSERT INTO `contest_prizes` (`id`, `contest_id`, `rank`, `prize_amount`, `created_at`, `updated_at`) VALUES
(132, 15, 1, 2000.00, '2026-07-01 09:35:57', '2026-07-01 09:35:57'),
(133, 15, 2, 1000.00, '2026-07-01 09:35:57', '2026-07-01 09:35:57'),
(143, 17, 1, 1000.00, '2026-07-01 11:02:54', '2026-07-01 11:02:54'),
(144, 16, 1, 2000.00, '2026-07-01 11:05:29', '2026-07-01 11:05:29'),
(145, 16, 2, 1000.00, '2026-07-01 11:05:29', '2026-07-01 11:05:29'),
(149, 18, 1, 10000.00, '2026-07-07 05:31:35', '2026-07-07 05:31:35'),
(150, 19, 1, 200.00, '2026-07-07 05:31:51', '2026-07-07 05:31:51'),
(151, 20, 1, 2000.00, '2026-07-07 05:37:07', '2026-07-07 05:37:07'),
(152, 20, 2, 1500.00, '2026-07-07 05:37:07', '2026-07-07 05:37:07'),
(153, 20, 3, 1000.00, '2026-07-07 05:37:07', '2026-07-07 05:37:07'),
(156, 21, 1, 2000.00, '2026-07-07 05:38:44', '2026-07-07 05:38:44'),
(157, 21, 2, 1000.00, '2026-07-07 05:38:44', '2026-07-07 05:38:44');

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

--
-- Table structure for table `contest_prize_assignments`
--

CREATE TABLE `contest_prize_assignments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `contest_prize_id` bigint(20) UNSIGNED NOT NULL,
  `rank` int(10) UNSIGNED NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `status` enum('assigned','paid','cancelled') NOT NULL DEFAULT 'assigned',
  `assigned_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `paid_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contest_prize_assignments`
--

INSERT INTO `contest_prize_assignments` (`id`, `contest_id`, `user_id`, `contest_prize_id`, `rank`, `amount`, `status`, `assigned_at`, `paid_at`, `created_at`, `updated_at`) VALUES
(5, 15, 8, 132, 1, 2000.00, 'assigned', '2026-07-01 10:35:51', NULL, '2026-07-01 09:36:00', '2026-07-01 10:35:51'),
(6, 15, 5, 133, 2, 1000.00, 'assigned', '2026-07-01 10:35:51', NULL, '2026-07-01 09:36:00', '2026-07-01 10:35:51');

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

--
-- Table structure for table `contest_registrations`
--

CREATE TABLE `contest_registrations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `entry_fee` decimal(10,2) NOT NULL DEFAULT 0.00,
  `payment_method` enum('free','online','wallet') NOT NULL DEFAULT 'free',
  `payment_status` enum('pending','paid','failed') NOT NULL DEFAULT 'pending',
  `status` enum('registered','cancelled') NOT NULL DEFAULT 'registered',
  `transaction_id` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `quiz_started_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contest_registrations`
--

INSERT INTO `contest_registrations` (`id`, `contest_id`, `user_id`, `entry_fee`, `payment_method`, `payment_status`, `status`, `transaction_id`, `created_at`, `updated_at`, `quiz_started_at`) VALUES
(19, 15, 8, 100.00, 'online', 'paid', 'registered', 'pay_T8BM6PaTa4jnGA', '2026-07-01 09:04:06', '2026-07-01 09:07:25', '2026-07-01 09:07:25'),
(20, 15, 5, 100.00, 'online', 'paid', 'registered', 'pay_T8BMIusY6Eq91g', '2026-07-01 09:04:13', '2026-07-01 09:06:09', '2026-07-01 09:06:09'),
(21, 16, 8, 0.00, 'free', 'paid', 'registered', NULL, '2026-07-01 10:19:06', '2026-07-01 10:25:01', '2026-07-01 10:25:01'),
(22, 16, 5, 0.00, 'free', 'paid', 'registered', NULL, '2026-07-01 10:19:14', '2026-07-01 10:24:39', '2026-07-01 10:24:39'),
(23, 17, 8, 0.00, 'free', 'paid', 'registered', NULL, '2026-07-01 10:55:53', '2026-07-01 11:01:02', '2026-07-01 11:01:02'),
(24, 17, 5, 0.00, 'free', 'paid', 'registered', NULL, '2026-07-01 10:56:03', '2026-07-01 11:00:12', '2026-07-01 11:00:12');

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

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2026_06_25_114931_create_password_resets_table', 1),
(5, '2026_06_26_075330_create_quiz_categories_table', 1),
(6, '2026_06_26_103403_create_contests_table', 1),
(7, '2026_06_26_103828_create_contest_prizes_table', 1),
(8, '2026_06_26_115136_create_questions_table', 2),
(9, '2026_06_27_055111_create_settings_table', 3),
(10, '2026_06_27_071642_add_avatar_to_users_table', 4),
(11, '2026_06_27_081645_add_verification_fields_to_users_table', 5),
(13, '2026_06_27_081856_create_otps_table', 6),
(14, '2026_06_27_115109_add_profile_fields_to_users_table', 7),
(15, '2026_06_27_180000_create_contact_inquiries_table', 8),
(16, '2026_06_29_072557_create_contest_registrations_table', 9),
(18, '2026_06_29_090908_create_quiz_answers_table', 10),
(19, '2026_06_29_092200_create_quiz_results_table', 11),
(20, '2026_06_29_164809_add_rank_generated_to_contests_table', 12),
(21, '2026_06_29_165418_add_time_taken_to_quiz_results_table', 13),
(22, '2026_06_29_175646_add_quiz_started_at_to_contest_registrations_table', 14),
(23, '2026_07_01_113819_create_contest_prize_assignments_table', 15);

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

--
-- Table structure for table `otps`
--

CREATE TABLE `otps` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `otp` varchar(6) NOT NULL,
  `expires_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `otps`
--

INSERT INTO `otps` (`id`, `user_id`, `otp`, `expires_at`, `created_at`, `updated_at`) VALUES
(4, 6, '354900', '2026-06-29 03:31:11', '2026-06-29 03:21:11', '2026-06-29 03:21:11'),
(5, 7, '883015', '2026-06-29 03:32:06', '2026-06-29 03:22:06', '2026-06-29 03:22:06');

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

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

CREATE TABLE `password_resets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `otp` varchar(6) NOT NULL,
  `expires_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `questions`
--

CREATE TABLE `questions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `question` text NOT NULL,
  `option_a` varchar(255) NOT NULL,
  `option_b` varchar(255) NOT NULL,
  `option_c` varchar(255) NOT NULL,
  `option_d` varchar(255) NOT NULL,
  `correct_answer` enum('A','B','C','D') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `questions`
--

INSERT INTO `questions` (`id`, `contest_id`, `question`, `option_a`, `option_b`, `option_c`, `option_d`, `correct_answer`, `created_at`, `updated_at`) VALUES
(43, 15, 'Capital of India?', 'Delhi', 'Mumbai', 'Chennai', 'Kolkata', 'A', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(44, 15, '2 + 2 = ?', '3', '4', '5', '6', 'B', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(45, 15, 'Largest Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(46, 15, 'What is the national animal of India?', 'Tiger', 'Lion', 'Elephant', 'Leopard', 'A', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(47, 15, 'Which planet is known as the Red Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'B', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(48, 15, 'Who wrote the Indian National Anthem?', 'Rabindranath Tagore', 'Bankim Chandra Chatterjee', 'Subhas Chandra Bose', 'Mahatma Gandhi', 'A', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(49, 15, 'Which is the largest ocean in the world?', 'Atlantic Ocean', 'Indian Ocean', 'Pacific Ocean', 'Arctic Ocean', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(50, 15, 'How many continents are there in the world?', '5', '6', '7', '8', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(51, 15, 'Which gas do plants absorb from the atmosphere?', 'Oxygen', 'Nitrogen', 'Carbon Dioxide', 'Hydrogen', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(52, 15, 'Which is the tallest mountain in the world?', 'K2', 'Mount Everest', 'Kangchenjunga', 'Nanga Parbat', 'B', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(53, 15, 'Who is known as the Father of the Nation in India?', 'Jawaharlal Nehru', 'Bhagat Singh', 'Mahatma Gandhi', 'Sardar Patel', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(54, 15, 'Which is the smallest prime number?', '0', '1', '2', '3', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(55, 15, 'Which river is known as the Ganga of South India?', 'Godavari', 'Narmada', 'Cauvery', 'Krishna', 'A', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(56, 15, 'What is the currency of Japan?', 'Yuan', 'Won', 'Yen', 'Ringgit', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(57, 15, 'Which organ pumps blood throughout the human body?', 'Lungs', 'Liver', 'Heart', 'Kidney', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(58, 15, 'Which is the fastest land animal?', 'Cheetah', 'Lion', 'Horse', 'Tiger', 'A', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(59, 15, 'Which is the capital city of Australia?', 'Sydney', 'Melbourne', 'Canberra', 'Perth', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(60, 15, 'How many days are there in a leap year?', '364', '365', '366', '367', 'C', '2026-07-01 09:05:20', '2026-07-01 09:05:20'),
(79, 16, 'Capital of India?', 'Delhi', 'Mumbai', 'Chennai', 'Kolkata', 'A', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(80, 16, '2 + 2 = ?', '3', '4', '5', '6', 'B', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(81, 16, 'Largest Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(82, 16, 'What is the national animal of India?', 'Tiger', 'Lion', 'Elephant', 'Leopard', 'A', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(83, 16, 'Which planet is known as the Red Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'B', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(84, 16, 'Who wrote the Indian National Anthem?', 'Rabindranath Tagore', 'Bankim Chandra Chatterjee', 'Subhas Chandra Bose', 'Mahatma Gandhi', 'A', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(85, 16, 'Which is the largest ocean in the world?', 'Atlantic Ocean', 'Indian Ocean', 'Pacific Ocean', 'Arctic Ocean', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(86, 16, 'How many continents are there in the world?', '5', '6', '7', '8', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(87, 16, 'Which gas do plants absorb from the atmosphere?', 'Oxygen', 'Nitrogen', 'Carbon Dioxide', 'Hydrogen', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(88, 16, 'Which is the tallest mountain in the world?', 'K2', 'Mount Everest', 'Kangchenjunga', 'Nanga Parbat', 'B', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(89, 16, 'Who is known as the Father of the Nation in India?', 'Jawaharlal Nehru', 'Bhagat Singh', 'Mahatma Gandhi', 'Sardar Patel', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(90, 16, 'Which is the smallest prime number?', '0', '1', '2', '3', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(91, 16, 'Which river is known as the Ganga of South India?', 'Godavari', 'Narmada', 'Cauvery', 'Krishna', 'A', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(92, 16, 'What is the currency of Japan?', 'Yuan', 'Won', 'Yen', 'Ringgit', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(93, 16, 'Which organ pumps blood throughout the human body?', 'Lungs', 'Liver', 'Heart', 'Kidney', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(94, 16, 'Which is the fastest land animal?', 'Cheetah', 'Lion', 'Horse', 'Tiger', 'A', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(95, 16, 'Which is the capital city of Australia?', 'Sydney', 'Melbourne', 'Canberra', 'Perth', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(96, 16, 'How many days are there in a leap year?', '364', '365', '366', '367', 'C', '2026-07-01 10:24:25', '2026-07-01 10:24:25'),
(97, 17, 'Capital of India?', 'Delhi', 'Mumbai', 'Chennai', 'Kolkata', 'A', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(98, 17, '2 + 2 = ?', '3', '4', '5', '6', 'B', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(99, 17, 'Largest Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(100, 17, 'What is the national animal of India?', 'Tiger', 'Lion', 'Elephant', 'Leopard', 'A', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(101, 17, 'Which planet is known as the Red Planet?', 'Earth', 'Mars', 'Jupiter', 'Venus', 'B', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(102, 17, 'Who wrote the Indian National Anthem?', 'Rabindranath Tagore', 'Bankim Chandra Chatterjee', 'Subhas Chandra Bose', 'Mahatma Gandhi', 'A', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(103, 17, 'Which is the largest ocean in the world?', 'Atlantic Ocean', 'Indian Ocean', 'Pacific Ocean', 'Arctic Ocean', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(104, 17, 'How many continents are there in the world?', '5', '6', '7', '8', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(105, 17, 'Which gas do plants absorb from the atmosphere?', 'Oxygen', 'Nitrogen', 'Carbon Dioxide', 'Hydrogen', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(106, 17, 'Which is the tallest mountain in the world?', 'K2', 'Mount Everest', 'Kangchenjunga', 'Nanga Parbat', 'B', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(107, 17, 'Who is known as the Father of the Nation in India?', 'Jawaharlal Nehru', 'Bhagat Singh', 'Mahatma Gandhi', 'Sardar Patel', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(108, 17, 'Which is the smallest prime number?', '0', '1', '2', '3', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(109, 17, 'Which river is known as the Ganga of South India?', 'Godavari', 'Narmada', 'Cauvery', 'Krishna', 'A', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(110, 17, 'What is the currency of Japan?', 'Yuan', 'Won', 'Yen', 'Ringgit', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(111, 17, 'Which organ pumps blood throughout the human body?', 'Lungs', 'Liver', 'Heart', 'Kidney', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(112, 17, 'Which is the fastest land animal?', 'Cheetah', 'Lion', 'Horse', 'Tiger', 'A', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(113, 17, 'Which is the capital city of Australia?', 'Sydney', 'Melbourne', 'Canberra', 'Perth', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31'),
(114, 17, 'How many days are there in a leap year?', '364', '365', '366', '367', 'C', '2026-07-01 11:00:31', '2026-07-01 11:00:31');

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

--
-- Table structure for table `quiz_answers`
--

CREATE TABLE `quiz_answers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `question_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `selected_answer` enum('A','B','C','D') DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quiz_answers`
--

INSERT INTO `quiz_answers` (`id`, `contest_id`, `question_id`, `user_id`, `selected_answer`, `created_at`, `updated_at`) VALUES
(49, 15, 43, 5, 'A', '2026-07-01 09:06:12', '2026-07-01 09:06:12'),
(50, 15, 44, 5, 'B', '2026-07-01 09:06:15', '2026-07-01 09:06:15'),
(51, 15, 45, 5, 'C', '2026-07-01 09:06:18', '2026-07-01 09:06:18'),
(52, 15, 46, 5, 'A', '2026-07-01 09:06:22', '2026-07-01 09:06:22'),
(53, 15, 47, 5, 'B', '2026-07-01 09:06:25', '2026-07-01 09:06:25'),
(54, 15, 48, 5, 'A', '2026-07-01 09:06:30', '2026-07-01 09:06:30'),
(55, 15, 49, 5, 'C', '2026-07-01 09:06:32', '2026-07-01 09:06:32'),
(56, 15, 50, 5, 'C', '2026-07-01 09:06:35', '2026-07-01 09:06:35'),
(57, 15, 51, 5, 'C', '2026-07-01 09:06:38', '2026-07-01 09:06:38'),
(58, 15, 52, 5, 'C', '2026-07-01 09:06:42', '2026-07-01 09:06:42'),
(59, 15, 53, 5, 'C', '2026-07-01 09:06:46', '2026-07-01 09:06:46'),
(60, 15, 54, 5, 'C', '2026-07-01 09:06:50', '2026-07-01 09:06:50'),
(61, 15, 55, 5, 'C', '2026-07-01 09:06:52', '2026-07-01 09:06:52'),
(62, 15, 56, 5, 'A', '2026-07-01 09:06:57', '2026-07-01 09:06:57'),
(63, 15, 57, 5, 'A', '2026-07-01 09:07:04', '2026-07-01 09:07:04'),
(64, 15, 58, 5, 'A', '2026-07-01 09:07:07', '2026-07-01 09:07:07'),
(65, 15, 59, 5, 'B', '2026-07-01 09:07:11', '2026-07-01 09:07:11'),
(66, 15, 60, 5, 'C', '2026-07-01 09:07:17', '2026-07-01 09:07:17'),
(67, 15, 43, 8, 'A', '2026-07-01 09:07:30', '2026-07-01 09:07:30'),
(68, 15, 44, 8, 'B', '2026-07-01 09:07:33', '2026-07-01 09:07:33'),
(69, 15, 45, 8, 'C', '2026-07-01 09:07:41', '2026-07-01 09:07:41'),
(70, 15, 46, 8, 'A', '2026-07-01 09:07:46', '2026-07-01 09:07:46'),
(71, 15, 47, 8, 'B', '2026-07-01 09:07:48', '2026-07-01 09:07:48'),
(72, 15, 48, 8, 'B', '2026-07-01 09:07:53', '2026-07-01 09:07:53'),
(73, 15, 49, 8, 'C', '2026-07-01 09:07:57', '2026-07-01 09:07:57'),
(74, 15, 50, 8, 'C', '2026-07-01 09:07:59', '2026-07-01 09:07:59'),
(75, 15, 51, 8, 'C', '2026-07-01 09:08:02', '2026-07-01 09:08:02'),
(76, 15, 52, 8, 'D', '2026-07-01 09:08:06', '2026-07-01 09:08:06'),
(77, 15, 53, 8, 'C', '2026-07-01 09:08:09', '2026-07-01 09:08:09'),
(78, 15, 54, 8, 'C', '2026-07-01 09:08:12', '2026-07-01 09:08:12'),
(79, 15, 55, 8, 'A', '2026-07-01 09:08:16', '2026-07-01 09:08:16'),
(80, 15, 56, 8, 'C', '2026-07-01 09:08:19', '2026-07-01 09:08:19'),
(81, 15, 57, 8, 'C', '2026-07-01 09:08:23', '2026-07-01 09:08:23'),
(82, 15, 58, 8, 'D', '2026-07-01 09:08:27', '2026-07-01 09:08:27'),
(83, 15, 59, 8, 'A', '2026-07-01 09:08:31', '2026-07-01 09:08:31'),
(84, 15, 60, 8, 'C', '2026-07-01 09:08:35', '2026-07-01 09:08:35'),
(85, 16, 79, 5, 'A', '2026-07-01 10:24:42', '2026-07-01 10:24:42'),
(86, 16, 80, 5, 'C', '2026-07-01 10:24:43', '2026-07-01 10:24:43'),
(87, 16, 81, 5, 'B', '2026-07-01 10:24:45', '2026-07-01 10:24:45'),
(88, 16, 82, 5, 'D', '2026-07-01 10:24:46', '2026-07-01 10:24:46'),
(89, 16, 83, 5, 'A', '2026-07-01 10:24:48', '2026-07-01 10:24:48'),
(90, 16, 84, 5, 'B', '2026-07-01 10:24:50', '2026-07-01 10:24:50'),
(91, 16, 85, 5, 'C', '2026-07-01 10:24:52', '2026-07-01 10:24:52'),
(92, 16, 86, 5, 'D', '2026-07-01 10:24:53', '2026-07-01 10:24:53'),
(93, 16, 87, 5, 'A', '2026-07-01 10:24:55', '2026-07-01 10:24:55'),
(94, 16, 88, 5, 'A', '2026-07-01 10:25:03', '2026-07-01 10:25:03'),
(95, 16, 89, 5, 'D', '2026-07-01 10:25:05', '2026-07-01 10:25:05'),
(96, 16, 90, 5, 'C', '2026-07-01 10:25:07', '2026-07-01 10:25:07'),
(97, 16, 91, 5, 'A', '2026-07-01 10:25:09', '2026-07-01 10:25:09'),
(98, 16, 92, 5, 'B', '2026-07-01 10:25:11', '2026-07-01 10:25:11'),
(99, 16, 93, 5, 'C', '2026-07-01 10:25:12', '2026-07-01 10:25:12'),
(100, 16, 94, 5, 'A', '2026-07-01 10:25:14', '2026-07-01 10:25:14'),
(101, 16, 95, 5, 'D', '2026-07-01 10:25:16', '2026-07-01 10:25:16'),
(102, 16, 96, 5, 'C', '2026-07-01 10:25:19', '2026-07-01 10:25:19'),
(103, 16, 79, 8, 'B', '2026-07-01 10:25:24', '2026-07-01 10:25:24'),
(104, 16, 80, 8, 'A', '2026-07-01 10:25:26', '2026-07-01 10:25:26'),
(105, 16, 81, 8, 'C', '2026-07-01 10:25:29', '2026-07-01 10:25:29'),
(106, 16, 82, 8, 'D', '2026-07-01 10:25:30', '2026-07-01 10:25:30'),
(107, 17, 97, 5, 'A', '2026-07-01 11:00:36', '2026-07-01 11:00:36'),
(108, 17, 98, 5, 'B', '2026-07-01 11:00:38', '2026-07-01 11:00:38'),
(109, 17, 99, 5, 'C', '2026-07-01 11:00:40', '2026-07-01 11:00:40'),
(110, 17, 100, 5, 'A', '2026-07-01 11:00:42', '2026-07-01 11:00:42'),
(111, 17, 101, 5, 'B', '2026-07-01 11:00:44', '2026-07-01 11:00:44'),
(112, 17, 102, 5, 'A', '2026-07-01 11:00:46', '2026-07-01 11:00:46'),
(113, 17, 103, 5, 'D', '2026-07-01 11:00:48', '2026-07-01 11:00:48'),
(114, 17, 104, 5, 'D', '2026-07-01 11:00:50', '2026-07-01 11:00:50'),
(115, 17, 105, 5, 'A', '2026-07-01 11:00:51', '2026-07-01 11:00:51'),
(116, 17, 106, 5, 'B', '2026-07-01 11:00:53', '2026-07-01 11:00:53'),
(117, 17, 97, 8, 'B', '2026-07-01 11:01:06', '2026-07-01 11:01:06'),
(118, 17, 98, 8, 'C', '2026-07-01 11:01:08', '2026-07-01 11:01:08'),
(119, 17, 99, 8, 'A', '2026-07-01 11:01:10', '2026-07-01 11:01:10'),
(120, 17, 100, 8, 'D', '2026-07-01 11:01:11', '2026-07-01 11:01:11'),
(121, 17, 101, 8, 'B', '2026-07-01 11:01:15', '2026-07-01 11:01:15'),
(122, 17, 102, 8, 'B', '2026-07-01 11:01:17', '2026-07-01 11:01:17'),
(123, 17, 103, 8, 'C', '2026-07-01 11:01:20', '2026-07-01 11:01:20'),
(124, 17, 104, 8, 'C', '2026-07-01 11:01:22', '2026-07-01 11:01:22'),
(125, 17, 105, 8, 'C', '2026-07-01 11:01:29', '2026-07-01 11:01:29'),
(126, 17, 106, 8, 'D', '2026-07-01 11:01:36', '2026-07-01 11:01:36'),
(127, 17, 107, 8, 'C', '2026-07-01 11:01:38', '2026-07-01 11:01:38'),
(128, 17, 108, 8, 'C', '2026-07-01 11:01:41', '2026-07-01 11:01:41'),
(129, 17, 109, 8, 'B', '2026-07-01 11:01:54', '2026-07-01 11:01:54'),
(130, 17, 110, 8, 'A', '2026-07-01 11:02:00', '2026-07-01 11:02:00'),
(131, 17, 111, 8, 'C', '2026-07-01 11:02:04', '2026-07-01 11:02:04'),
(132, 17, 112, 8, 'C', '2026-07-01 11:02:06', '2026-07-01 11:02:06'),
(133, 17, 113, 8, 'C', '2026-07-01 11:02:08', '2026-07-01 11:02:08'),
(134, 17, 114, 8, 'C', '2026-07-01 11:02:11', '2026-07-01 11:02:11'),
(135, 17, 107, 5, 'D', '2026-07-01 11:02:17', '2026-07-01 11:02:17'),
(136, 17, 108, 5, 'D', '2026-07-01 11:02:20', '2026-07-01 11:02:20'),
(137, 17, 109, 5, 'A', '2026-07-01 11:02:21', '2026-07-01 11:02:21'),
(138, 17, 110, 5, 'B', '2026-07-01 11:02:23', '2026-07-01 11:02:23'),
(139, 17, 111, 5, 'D', '2026-07-01 11:02:25', '2026-07-01 11:02:25'),
(140, 17, 112, 5, 'C', '2026-07-01 11:02:26', '2026-07-01 11:02:26'),
(141, 17, 113, 5, 'B', '2026-07-01 11:02:28', '2026-07-01 11:02:28'),
(142, 17, 114, 5, 'C', '2026-07-01 11:02:31', '2026-07-01 11:02:31');

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

--
-- Table structure for table `quiz_categories`
--

CREATE TABLE `quiz_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quiz_categories`
--

INSERT INTO `quiz_categories` (`id`, `name`, `image`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Physics', 'categories/qkuDwhxiXfQ17hpCs5xZFPQJl1LbnxtgHD8r1AvE.jpg', 1, '2026-06-26 05:36:00', '2026-06-26 05:36:00'),
(2, 'Maths', 'categories/3XyqgNIS1G1UvCRG5I447PDHDdESXc1WOqIF8TNe.jpg', 1, '2026-06-26 05:37:26', '2026-06-26 05:37:26'),
(3, 'GK', 'categories/pbOaK8amF0QYyTQuxsd5H9o99FAWtbz8k3PvdCL3.jpg', 1, '2026-06-26 05:37:36', '2026-06-26 05:37:36'),
(4, 'Chemistry', 'categories/S1ilrCAy1zLi2CHSDbfUGJNS82q4GzrHnNoYnRYh.jpg', 1, '2026-06-29 00:02:17', '2026-06-29 00:02:17'),
(5, 'Biology', 'categories/b2HuMg6ZtsGUd3rqR7OMjKLxm9Y3HvT4wiqYO7Nz.jpg', 1, '2026-06-29 00:02:31', '2026-06-29 00:02:31'),
(6, 'Computer', 'categories/h31ivPfKhGqmmevtNneFh9HSKnNfHTDhHLesQZDQ.jpg', 1, '2026-06-29 00:02:45', '2026-06-29 00:02:45'),
(7, 'Science', 'categories/LNMcgU8hykgTNViurpxDZ2bIyJRftw6Hj3WIiR64.jpg', 1, '2026-06-29 00:02:56', '2026-06-29 00:02:56'),
(8, 'Artificial Intelligence', 'categories/dWHl8FKsQs3xDqWIYcuuFDBzN34FDVZZVEokMzq5.jpg', 1, '2026-06-29 00:03:43', '2026-06-29 00:03:43'),
(9, 'Stock Market', 'categories/njXIlH0je3y1lz8k0KCiWSutTQR82XFllsg3MNjM.jpg', 1, '2026-06-29 00:04:30', '2026-06-29 00:04:30'),
(11, 'Sports', 'categories/KnYoSFGnjJaAAFbcT5Vz5uwFw7vyC3dO3mENutSY.jpg', 1, '2026-06-29 00:14:18', '2026-06-29 00:14:18');

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

--
-- Table structure for table `quiz_results`
--

CREATE TABLE `quiz_results` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contest_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `total_questions` int(10) UNSIGNED NOT NULL,
  `correct_answers` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `wrong_answers` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `unanswered` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `score` decimal(8,2) NOT NULL DEFAULT 0.00,
  `percentage` decimal(5,2) NOT NULL DEFAULT 0.00,
  `time_taken` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `rank` int(10) UNSIGNED DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `quiz_results`
--

INSERT INTO `quiz_results` (`id`, `contest_id`, `user_id`, `total_questions`, `correct_answers`, `wrong_answers`, `unanswered`, `score`, `percentage`, `time_taken`, `rank`, `submitted_at`, `created_at`, `updated_at`) VALUES
(14, 15, 5, 18, 13, 5, 0, 13.00, 72.22, 931, 2, '2026-07-01 09:21:39', '2026-07-01 09:07:17', '2026-07-01 09:36:00'),
(15, 15, 8, 18, 14, 4, 0, 14.00, 77.78, 70, 1, '2026-07-01 09:08:35', '2026-07-01 09:08:35', '2026-07-01 09:36:00'),
(16, 16, 5, 18, 7, 11, 0, 7.00, 38.89, 271, 1, '2026-07-01 10:29:10', '2026-07-01 10:25:19', '2026-07-01 10:35:51'),
(17, 16, 8, 18, 1, 3, 14, 1.00, 5.56, 165, 2, '2026-07-01 10:27:46', '2026-07-01 10:27:46', '2026-07-01 10:35:51'),
(18, 17, 8, 18, 9, 9, 0, 9.00, 50.00, 508, NULL, '2026-07-01 11:09:30', '2026-07-01 11:02:11', '2026-07-01 11:09:30'),
(19, 17, 5, 18, 9, 9, 0, 9.00, 50.00, 140, NULL, '2026-07-01 11:02:31', '2026-07-01 11:02:31', '2026-07-01 11:02:31');

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

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('9XCxZuB5sAJQNGVvUGfDkDD6A0byxgXcG6GAqE0E', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiOTY3b0NwRlQ1c3ZEeDhqN2luWVRrTlVBYjd3MmlBNWRSRng4ZFV4TCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MzY6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi9jYXRlZ29yeSI7czo1OiJyb3V0ZSI7czoyMDoiYWRtaW4uY2F0ZWdvcnkuaW5kZXgiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1783421840),
('dl6Dpxc5Y3wHUx6QEpkbmHeBCBKIRZ2nzFZdNOxL', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiS0NmNEgyZjFFelJUODM4bWNHUXhSUW5lelEzTlhwdUk2N0loR2t2YSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MzU6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi9jb250ZXN0IjtzOjU6InJvdXRlIjtzOjE5OiJhZG1pbi5jb250ZXN0LmluZGV4Ijt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozNjoiaHR0cDovLzEyNy4wLjAuMTo4MDAwL3F1aXovMTkvcmVzdWx0Ijt9czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTt9', 1783403339),
('tAchgghPg8JmenK8VSrC5a0dfdPuS80n5uqPlvA8', 5, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoibmpQQVBGbkI3aVFVMnNFaTNWRnc4WTBmdmlSczFJYzloNFhoMm8zcyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMCI7czo1OiJyb3V0ZSI7czo0OiJob21lIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6NTt9', 1783404334);

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `key` varchar(255) NOT NULL,
  `value` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `key`, `value`, `created_at`, `updated_at`) VALUES
(1, 'app_name', 'BRAINTHINKS', '2026-06-27 00:44:52', '2026-06-27 00:44:52'),
(2, 'support_email', 'Id-brainthinks99@gmail.com', '2026-06-27 00:44:52', '2026-06-27 00:44:52'),
(3, 'support_mobile', '9981446067', '2026-06-27 00:44:52', '2026-06-27 00:44:52'),
(4, 'timezone', 'Asia/Kolkata', '2026-06-27 00:44:52', '2026-06-29 05:01:31'),
(5, 'copyright', 'Rays IT and Design World', '2026-06-27 00:44:52', '2026-06-27 00:44:52'),
(6, 'logo', 'settings/Xf7gs92FoILis8AzG1wXUtMElRaOylrhoTN0h8ko.jpg', '2026-06-27 00:44:53', '2026-06-27 01:38:28'),
(7, 'default_quiz_duration', '30', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(8, 'passing_percentage', '80', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(9, 'marks_per_question', '1', '2026-06-27 00:52:01', '2026-07-01 08:56:24'),
(10, 'negative_marks', '0.25', '2026-06-27 00:52:01', '2026-07-01 08:47:18'),
(11, 'negative_marking', '1', '2026-06-27 00:52:01', '2026-07-01 08:56:56'),
(12, 'shuffle_questions', '1', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(13, 'shuffle_options', '1', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(14, 'allow_multiple_attempts', '0', '2026-06-27 00:52:01', '2026-07-01 09:19:05'),
(15, 'show_result_after_quiz', '1', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(16, 'show_correct_answers', '1', '2026-06-27 00:52:01', '2026-06-27 00:52:01'),
(17, 'razorpay_key', 'rzp_test_1234567890', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(18, 'razorpay_secret', 'test_secret_987654321', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(19, 'cashfree_app_id', 'CF_APP_TEST_12345', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(20, 'cashfree_secret', 'cashfree_secret_demo_67890', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(21, 'phonepe_merchant_id', 'PGTESTPAYUAT123', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(22, 'phonepe_salt_key', 'salt_key_demo_123456', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(23, 'upi_id', 'demo@upi', '2026-06-27 00:58:47', '2026-06-27 00:58:47'),
(24, 'enable_referral', '1', '2026-06-27 01:01:24', '2026-06-27 01:01:24'),
(25, 'signup_bonus', '100', '2026-06-27 01:01:24', '2026-06-27 01:01:24'),
(26, 'referral_bonus', '10', '2026-06-27 01:01:24', '2026-06-27 01:01:24'),
(27, 'per_invite_reward', '50', '2026-06-27 01:01:24', '2026-06-27 01:01:24'),
(28, 'wallet_enable', '1', '2026-06-27 01:03:02', '2026-06-27 01:03:02'),
(29, 'minimum_withdraw', '100', '2026-06-27 01:03:02', '2026-06-27 01:03:02'),
(30, 'maximum_withdraw', '500', '2026-06-27 01:03:02', '2026-06-27 01:03:02'),
(31, 'withdrawal_charge', '2', '2026-06-27 01:03:02', '2026-06-27 01:03:02'),
(32, 'facebook', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(33, 'instagram', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(34, 'youtube', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(35, 'telegram', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(36, 'twitter', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(37, 'linkedin', 'https://www.raysitworld.com/', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(38, 'website', 'https://www.iyouth.in', '2026-06-27 01:07:10', '2026-06-27 01:07:10'),
(39, 'meta_title', 'Brainthinks - Be Innovative | Play Online Quiz Contests & Win Rewards', '2026-06-27 01:10:26', '2026-06-27 01:10:26'),
(40, 'meta_description', 'Brainthinks - Be Innovative | Play Online Quiz Contests & Win Rewards', '2026-06-27 01:10:26', '2026-06-27 01:10:26'),
(41, 'meta_keywords', 'Brainthinks, Be Innovative, online quiz, quiz contest, GK quiz, trivia, learning platform, quiz app, knowledge competition, win rewards', '2026-06-27 01:10:26', '2026-06-27 01:10:26'),
(42, 'dark_logo', 'settings/V2ANbrqOVlHUMPUspsGQLaxroMRjmYrj8bJEOZFc.jpg', '2026-06-27 01:25:05', '2026-06-27 01:38:28'),
(43, 'address', 'BRAINTHINKS SOLUTION ADDRESS- WARD NO-31 BAJRANG CHOWK KHARMORA DISTRICT-KORBA STATE-CHHATTISGARH PIN-495682', '2026-06-27 02:23:40', '2026-06-27 02:23:40');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `is_verified` tinyint(1) NOT NULL DEFAULT 0,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `role` enum('admin','user') NOT NULL DEFAULT 'user',
  `remember_token` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `gender` enum('Male','Female','Other') DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `pincode` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `phone`, `avatar`, `email_verified_at`, `password`, `is_verified`, `status`, `role`, `remember_token`, `created_at`, `updated_at`, `gender`, `dob`, `state`, `city`, `pincode`, `address`) VALUES
(1, 'Admin', 'harshvermapc5@gmail.com', NULL, 'avatars/lbgU7NaaSANKOzob8WAUB3Dq6qMWckN6yBQksZEn.jpg', NULL, '$2y$12$81RU3l67ZRR91z7zP1stce25nUXltAm1oxjBHwIAraO0ddj1GZgCW', 0, 1, 'admin', NULL, NULL, '2026-06-27 02:18:33', NULL, NULL, NULL, NULL, NULL, NULL),
(4, 'Harsh', 'harshvermapc6@gmail.com', '09131550312', 'avatars/fcQnIbBbuTCTH4IcWW1BCwqSGtYBKrGf32Z3bD9C.jpg', NULL, '$2y$12$rSnGMjT/4xwINLPQJQYnmOnmUj7NSnt2nEbYyEXn7dRsI3a2XJbhm', 1, 1, 'user', NULL, '2026-06-27 03:18:21', '2026-06-27 06:52:31', 'Male', '2026-06-27', 'Chhattisgarh', 'Bhilai', '493116', 'Green valley bhilai'),
(5, 'Harsh', 'yker132@gmail.com', '9131550312', 'avatars/BvtL3iEpQgAt4YGWybUtXhgwkth88xeuSdq7Neq0.jpg', NULL, '$2y$12$9Q/nMFpM2zF9Ixvn5vrmBOxP6PUZuQMLJAANe8g/a2tNw1X8GZ/hC', 1, 1, 'user', NULL, '2026-06-27 03:43:28', '2026-06-27 06:27:43', 'Male', '2026-06-02', 'Chhattisgarh', 'Raipur', '491331', 'Bemetara Chhattisgarh'),
(6, 'Test', 'harshvermareffidmailcom369@gmail.com', NULL, NULL, NULL, '$2y$12$99FOG1kpCucaws6y3YUeK.MFy17vdTrylo/Rg/USfux.FBI3zZK1.', 0, 1, 'user', NULL, '2026-06-29 03:21:11', '2026-06-29 03:21:11', NULL, NULL, NULL, NULL, NULL, NULL),
(7, 'Test', 'harshvermareffifmailcom369@gmail.com', NULL, NULL, NULL, '$2y$12$O.X00c2I8OTFVanK3fF7wODnj5kpae8KWhmBjT0PqkELrPc4qK/7a', 0, 1, 'user', NULL, '2026-06-29 03:22:06', '2026-06-29 03:22:06', NULL, NULL, NULL, NULL, NULL, NULL),
(8, 'Test', 'harshvermareddifmailcom369@gmail.com', '9131550312', 'avatars/fqjZ5xj2etrzKg5t84Y813gzx9yjYuX2zwdlYG7S.jpg', NULL, '$2y$12$Cvg5wsKEsp7Ie2Mi998yJePifdNd9alyNFem9kVXVXGiS/1jxelu.', 1, 1, 'user', NULL, '2026-06-29 03:22:37', '2026-06-29 03:23:43', 'Male', '2026-06-01', 'Chhattisgarh', 'Raipur', '490020', 'Bemetara Chhattisgarh');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_expiration_index` (`expiration`);

--
-- Indexes for table `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`),
  ADD KEY `cache_locks_expiration_index` (`expiration`);

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

--
-- Indexes for table `contests`
--
ALTER TABLE `contests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contests_category_id_foreign` (`category_id`);

--
-- Indexes for table `contest_prizes`
--
ALTER TABLE `contest_prizes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contest_prizes_contest_id_foreign` (`contest_id`);

--
-- Indexes for table `contest_prize_assignments`
--
ALTER TABLE `contest_prize_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contest_prize_assignments_contest_id_foreign` (`contest_id`),
  ADD KEY `contest_prize_assignments_user_id_foreign` (`user_id`),
  ADD KEY `contest_prize_assignments_contest_prize_id_foreign` (`contest_prize_id`);

--
-- Indexes for table `contest_registrations`
--
ALTER TABLE `contest_registrations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `contest_registrations_contest_id_user_id_unique` (`contest_id`,`user_id`),
  ADD KEY `contest_registrations_user_id_foreign` (`user_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

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

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

--
-- Indexes for table `otps`
--
ALTER TABLE `otps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `otps_user_id_foreign` (`user_id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `questions_contest_id_foreign` (`contest_id`);

--
-- Indexes for table `quiz_answers`
--
ALTER TABLE `quiz_answers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `quiz_answers_contest_id_question_id_user_id_unique` (`contest_id`,`question_id`,`user_id`),
  ADD KEY `quiz_answers_question_id_foreign` (`question_id`),
  ADD KEY `quiz_answers_user_id_foreign` (`user_id`);

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

--
-- Indexes for table `quiz_results`
--
ALTER TABLE `quiz_results`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `quiz_results_contest_id_user_id_unique` (`contest_id`,`user_id`),
  ADD KEY `quiz_results_user_id_foreign` (`user_id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `settings_key_unique` (`key`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `contact_inquiries`
--
ALTER TABLE `contact_inquiries`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `contests`
--
ALTER TABLE `contests`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `contest_prizes`
--
ALTER TABLE `contest_prizes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=158;

--
-- AUTO_INCREMENT for table `contest_prize_assignments`
--
ALTER TABLE `contest_prize_assignments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `contest_registrations`
--
ALTER TABLE `contest_registrations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `otps`
--
ALTER TABLE `otps`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `password_resets`
--
ALTER TABLE `password_resets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `questions`
--
ALTER TABLE `questions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=115;

--
-- AUTO_INCREMENT for table `quiz_answers`
--
ALTER TABLE `quiz_answers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=143;

--
-- AUTO_INCREMENT for table `quiz_categories`
--
ALTER TABLE `quiz_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `quiz_results`
--
ALTER TABLE `quiz_results`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `contests`
--
ALTER TABLE `contests`
  ADD CONSTRAINT `contests_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `quiz_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contest_prizes`
--
ALTER TABLE `contest_prizes`
  ADD CONSTRAINT `contest_prizes_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contest_prize_assignments`
--
ALTER TABLE `contest_prize_assignments`
  ADD CONSTRAINT `contest_prize_assignments_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contest_prize_assignments_contest_prize_id_foreign` FOREIGN KEY (`contest_prize_id`) REFERENCES `contest_prizes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contest_prize_assignments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contest_registrations`
--
ALTER TABLE `contest_registrations`
  ADD CONSTRAINT `contest_registrations_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contest_registrations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `otps`
--
ALTER TABLE `otps`
  ADD CONSTRAINT `otps_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `questions`
--
ALTER TABLE `questions`
  ADD CONSTRAINT `questions_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quiz_answers`
--
ALTER TABLE `quiz_answers`
  ADD CONSTRAINT `quiz_answers_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quiz_answers_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quiz_answers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `quiz_results`
--
ALTER TABLE `quiz_results`
  ADD CONSTRAINT `quiz_results_contest_id_foreign` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `quiz_results_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
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 */;
