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

START TRANSACTION;



--
-- Database: `absen`
--

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

--
-- Table structure for table `absen`
--

CREATE TABLE `absen` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `id_jam_pelajaran` bigint(20) UNSIGNED NOT NULL,
  `id_siswa` bigint(20) UNSIGNED NOT NULL,
  `status` tinyint(4) NOT NULL,
  `date` datetime 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 `absen`
--

INSERT INTO `absen` (`id`, `id_jam_pelajaran`, `id_siswa`, `status`, `date`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 10, '2023-05-20 07:00:00', '2023-07-20 14:02:05', '2023-07-20 14:02:05'),
(2, 2, 1, 10, '2023-07-22 23:34:39', '2023-07-22 23:34:40', '2023-07-22 23:34:40'),
(3, 2, 2, 10, '2023-07-22 23:34:39', '2023-07-22 23:34:40', '2023-07-22 23:34:40'),
(4, 2, 3, 10, '2023-07-22 23:34:39', '2023-07-22 23:34:40', '2023-07-22 23:34:40'),
(5, 2, 1, 10, '2023-07-22 23:35:19', '2023-07-22 23:35:19', '2023-07-22 23:35:19'),
(6, 2, 2, 0, '2023-07-22 23:35:19', '2023-07-22 23:35:19', '2023-07-22 23:35:19'),
(7, 2, 3, 0, '2023-07-22 23:35:19', '2023-07-22 23:35:19', '2023-07-22 23:35:19'),
(8, 1, 1, 0, '2023-07-23 00:17:35', '2023-07-23 00:17:36', '2023-07-23 00:17:36'),
(9, 1, 2, 10, '2023-07-23 00:17:35', '2023-07-23 00:17:36', '2023-07-23 00:17:36'),
(10, 1, 3, 8, '2023-07-23 00:17:35', '2023-07-23 00:17:36', '2023-07-23 00:17:36'),
(11, 3, 4, 10, '2023-07-23 01:11:32', '2023-07-23 01:11:33', '2023-07-23 01:11:33'),
(12, 3, 5, 10, '2023-07-23 01:11:32', '2023-07-23 01:11:33', '2023-07-23 01:11:33'),
(13, 3, 4, 9, '2023-07-23 01:11:53', '2023-07-23 01:11:54', '2023-07-23 01:11:54'),
(14, 3, 5, 10, '2023-07-23 01:11:53', '2023-07-23 01:11:54', '2023-07-23 01:11:54');

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

--
-- Table structure for table `jam_pelajaran`
--

CREATE TABLE `jam_pelajaran` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `id_pegawai` bigint(20) UNSIGNED NOT NULL,
  `id_kelas` bigint(20) UNSIGNED NOT NULL,
  `id_mata_pelajaran` bigint(20) UNSIGNED NOT NULL,
  `days` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time_start` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time_end` 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;

--
-- Dumping data for table `jam_pelajaran`
--

INSERT INTO `jam_pelajaran` (`id`, `id_pegawai`, `id_kelas`, `id_mata_pelajaran`, `days`, `time_start`, `time_end`, `created_at`, `updated_at`) VALUES
(1, 2, 1, 1, 'Rabu', '07:00', '09:00', '2023-07-20 14:01:25', '2023-07-22 23:25:36'),
(2, 2, 1, 2, 'Rabu', '09:00', '12:00', '2023-07-22 23:26:15', '2023-07-22 23:26:15'),
(3, 2, 2, 2, 'Selasa', '07:00', '09:00', '2023-07-23 01:11:01', '2023-07-23 01:11:01');

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

--
-- Table structure for table `kelas`
--

CREATE TABLE `kelas` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `jurusan` varchar(255) COLLATE utf8mb4_unicode_ci 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;

--
-- Dumping data for table `kelas`
--

INSERT INTO `kelas` (`id`, `jurusan`, `name`, `created_at`, `updated_at`) VALUES
(1, 'IPA', 'IPA 1', '2023-07-20 14:00:42', '2023-07-20 14:00:42'),
(2, 'IPA', 'IPA 2', '2023-07-22 23:21:18', '2023-07-22 23:21:18');

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

--
-- Table structure for table `mata_pelajaran`
--

CREATE TABLE `mata_pelajaran` (
  `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;

--
-- Dumping data for table `mata_pelajaran`
--

INSERT INTO `mata_pelajaran` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Matematika', '2023-07-20 14:01:02', '2023-07-20 14:01:02'),
(2, 'Fisika', '2023-07-22 23:17:19', '2023-07-22 23:17:19');

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

--
-- Table structure for table `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;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(2, '2023_07_16_070727_create_pegawai_table', 1),
(3, '2023_07_17_152634_create_kelas_table', 1),
(4, '2023_07_17_171030_create_siswa_table', 1),
(5, '2023_07_17_213208_create_mata_pelajaran', 1),
(6, '2023_07_17_224258_create_jam_pelajaran', 1),
(7, '2023_07_18_152721_create_absen_table', 1);

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

--
-- Table structure for table `siswa`
--

CREATE TABLE `siswa` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `id_kelas` bigint(20) UNSIGNED NOT NULL,
  `number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `no_telp` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `alamat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `gender` tinyint(4) NOT NULL,
  `status` tinyint(4) 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 `siswa`
--

INSERT INTO `siswa` (`id`, `id_kelas`, `number`, `name`, `email`, `no_telp`, `alamat`, `date`, `gender`, `status`, `created_at`, `updated_at`) VALUES
(1, 1, 'NIS15900018159', 'Andri Rizki Saputra', 'andri.rizki007@gmail.com', '082322525083', 'Muja Muju, UH II 902, DI Yogyakarta', '2222-02-22', 1, 10, '2023-07-20 14:00:52', '2023-07-20 14:00:52'),
(2, 1, 'NIS15900018160', 'Lawliet', 'lawliet@gmail.com', '083224535082', 'Bandung', '1995-03-02', 1, 10, '2023-07-22 23:15:37', '2023-07-22 23:15:37'),
(3, 1, 'NIS15900018161', 'Near', 'near@gmail.com', '082355345023', 'Yogyakarta', '1995-08-08', 2, 10, '2023-07-22 23:16:51', '2023-07-22 23:16:51'),
(4, 2, 'NIS15900018163', 'Melow', 'melow@gmail.com', '081353525073', 'Yogyakarta', '1995-04-04', 1, 10, '2023-07-22 23:23:01', '2023-07-22 23:23:01'),
(5, 2, 'NIS15900018164', 'Mus', 'mus@gmail.com', '082331555011', 'Yogyakarta', '1995-07-07', 2, 10, '2023-07-22 23:24:19', '2023-07-22 23:24:19');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `absen`
--
ALTER TABLE `absen`
  ADD PRIMARY KEY (`id`),
  ADD KEY `absen_id_jam_pelajaran_foreign` (`id_jam_pelajaran`),
  ADD KEY `absen_id_siswa_foreign` (`id_siswa`);

--
-- Indexes for table `jam_pelajaran`
--
ALTER TABLE `jam_pelajaran`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jam_pelajaran_id_kelas_foreign` (`id_kelas`),
  ADD KEY `jam_pelajaran_id_mata_pelajaran_foreign` (`id_mata_pelajaran`),
  ADD KEY `jam_pelajaran_id_pegawai_foreign` (`id_pegawai`);

--
-- Indexes for table `kelas`
--
ALTER TABLE `kelas`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kelas_name_unique` (`name`);

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

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

--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `siswa_number_unique` (`number`),
  ADD KEY `siswa_id_kelas_foreign` (`id_kelas`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `absen`
--
ALTER TABLE `absen`
  ADD CONSTRAINT `absen_id_jam_pelajaran_foreign` FOREIGN KEY (`id_jam_pelajaran`) REFERENCES `jam_pelajaran` (`id`),
  ADD CONSTRAINT `absen_id_siswa_foreign` FOREIGN KEY (`id_siswa`) REFERENCES `siswa` (`id`);

--
-- Constraints for table `jam_pelajaran`
--
ALTER TABLE `jam_pelajaran`
  ADD CONSTRAINT `jam_pelajaran_id_kelas_foreign` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id`),
  ADD CONSTRAINT `jam_pelajaran_id_mata_pelajaran_foreign` FOREIGN KEY (`id_mata_pelajaran`) REFERENCES `mata_pelajaran` (`id`),
  ADD CONSTRAINT `jam_pelajaran_id_pegawai_foreign` FOREIGN KEY (`id_pegawai`) REFERENCES `pegawai` (`id`);

--
-- Constraints for table `siswa`
--
ALTER TABLE `siswa`
  ADD CONSTRAINT `siswa_id_kelas_foreign` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id`);
COMMIT;

