text: -- phpMyAdmin SQL Dump
  -- version 5.1.0
  -- https://www.phpmyadmin.net/
  --
  -- Servidor: 127.0.0.1
  -- Tiempo de generación: 23-03-2022 a las 16:49:53
  -- Versión del servidor: 10.4.19-MariaDB
  -- Versión de PHP: 7.3.28
  
  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 */;
  
  --
  -- Base de datos: `crud`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `courses`
  --
  
  CREATE TABLE `courses` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `courses`
  --
  
  INSERT INTO `courses` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Curso de Base de Datos', '2022-03-23 15:04:11', '2022-03-23 15:04:11');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `failed_jobs`
  --
  
  CREATE TABLE `failed_jobs` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (1, '2014_10_12_000000_create_users_table', 1),
  (2, '2014_10_12_100000_create_password_resets_table', 1),
  (3, '2019_08_19_000000_create_failed_jobs_table', 1),
  (4, '2022_03_23_002052_create_courses_table', 1),
  (5, '2022_03_23_002159_create_quiz_table', 1),
  (6, '2022_03_23_002541_create_quiz_feedback_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `quiz`
  --
  
  CREATE TABLE `quiz` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `course_id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `intro` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `attempts` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `quiz`
  --
  
  INSERT INTO `quiz` (`id`, `course_id`, `name`, `intro`, `attempts`, `created_at`, `updated_at`) VALUES
  (6, 1, 'Luis Claudio', 'demo', 1, '2022-03-23 20:44:51', '2022-03-23 20:44:51');
  
  --
  -- Disparadores `quiz`
  --
  DELIMITER $$
  CREATE TRIGGER `Insertar Quiz Id` AFTER INSERT ON `quiz` FOR EACH ROW INSERT INTO quiz_feedback (quiz_id,created_at,updated_at)
      VALUES (NEW.id, now() , now() )
  $$
  DELIMITER ;
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `quiz_feedback`
  --
  
  CREATE TABLE `quiz_feedback` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `quiz_id` bigint(20) UNSIGNED NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `quiz_feedback`
  --
  
  INSERT INTO `quiz_feedback` (`id`, `quiz_id`, `created_at`, `updated_at`) VALUES
  (3, 6, '2022-03-23 15:44:51', '2022-03-23 15:44:51');
  
  -- --------------------------------------------------------
  
  --
  -- Estructura de tabla para la tabla `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Volcado de datos para la tabla `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, 'Luis Augusto', 'luis.claudio@perutec.com.pe', NULL, '$2y$10$wpCctsVIdV.92KXaZLqTlewh3CWKbLcxxXw2FtD8LcR2sm.eRf7Ki', NULL, '2022-03-23 05:33:30', '2022-03-23 05:33:30');
  
  --
  -- Índices para tablas volcadas
  --
  
  --
  -- Indices de la tabla `courses`
  --
  ALTER TABLE `courses`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indices de la tabla `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indices de la tabla `quiz`
  --
  ALTER TABLE `quiz`
    ADD PRIMARY KEY (`id`),
    ADD KEY `quiz_course_id_foreign` (`course_id`);
  
  --
  -- Indices de la tabla `quiz_feedback`
  --
  ALTER TABLE `quiz_feedback`
    ADD PRIMARY KEY (`id`),
    ADD KEY `quiz_feedback_quiz_id_foreign` (`quiz_id`);
  
  --
  -- Indices de la tabla `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- AUTO_INCREMENT de las tablas volcadas
  --
  
  --
  -- AUTO_INCREMENT de la tabla `courses`
  --
  ALTER TABLE `courses`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT de la tabla `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT de la tabla `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT de la tabla `quiz`
  --
  ALTER TABLE `quiz`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT de la tabla `quiz_feedback`
  --
  ALTER TABLE `quiz_feedback`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT de la tabla `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Restricciones para tablas volcadas
  --
  
  --
  -- Filtros para la tabla `quiz`
  --
  ALTER TABLE `quiz`
    ADD CONSTRAINT `quiz_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`);
  
  --
  -- Filtros para la tabla `quiz_feedback`
  --
  ALTER TABLE `quiz_feedback`
    ADD CONSTRAINT `quiz_feedback_quiz_id_foreign` FOREIGN KEY (`quiz_id`) REFERENCES `quiz` (`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 */;
  