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

START TRANSACTION;



--
-- Database: `eabsensi`
--

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

--
-- Table structure for table `absensi`
--

CREATE TABLE `absensi` (
  `id` int(11) NOT NULL,
  `siswa_id` int(11) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `mapel_id` int(11) NOT NULL,
  `tanggal` datetime NOT NULL DEFAULT current_timestamp(),
  `status` enum('Hadir','Izin','Sakit','Bolos','Alpa') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `absensi_guru`
--

CREATE TABLE `absensi_guru` (
  `id` int(11) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `waktu` enum('jam_ke_1','jam_ke_2','jam_ke_3','jam_ke_4','jam_ke_5','jam_ke_6','jam_ke_7','jam_ke_8') NOT NULL,
  `status` enum('hadir','terlambat','izin','sakit','alpa_tanpa_keterangan') NOT NULL,
  `keterangan` text DEFAULT NULL,
  `jam_absen` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `agenda_harian`
--

CREATE TABLE `agenda_harian` (
  `id` int(11) NOT NULL,
  `hari` varchar(20) DEFAULT NULL,
  `tanggal` date DEFAULT NULL,
  `kelas` varchar(50) DEFAULT NULL,
  `jam_ke` varchar(10) DEFAULT NULL,
  `kompetensi_dasar` text DEFAULT NULL,
  `indikator` text DEFAULT NULL,
  `kegiatan` text DEFAULT NULL,
  `mapel` varchar(100) DEFAULT NULL,
  `guru_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `jadwal_guru`
--

CREATE TABLE `jadwal_guru` (
  `id` int(11) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `hari` varchar(10) NOT NULL,
  `kelas_id` int(11) DEFAULT NULL,
  `mapel_id` int(11) DEFAULT NULL,
  `jam_ke` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `kelas` (
  `id` int(11) NOT NULL,
  `nama` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `kelas` (`id`, `nama`) VALUES
(1, 'X TKJ 1'),
(2, 'X TKJ 2'),
(3, 'X TKJ 3'),
(4, 'XI TKJ 1'),
(5, 'XI TKJ 2'),
(6, 'XI TKJ 3'),
(7, 'XII TKJ 1'),
(8, 'XII TKJ 2'),
(9, 'XII TKJ 3'),
(10, 'X TKR 1'),
(11, 'X TKR 2'),
(12, 'X TKR 3'),
(13, 'XI TKR 1'),
(14, 'XI TKR 2'),
(15, 'XI TKR 3'),
(16, 'XII TKR 1'),
(17, 'XII TKR 2'),
(18, 'XII TKR 3'),
(19, 'X TSM 1'),
(20, 'X TSM 2'),
(21, 'X TSM 3'),
(22, 'XI TSM 1'),
(23, 'XI TSM 2'),
(24, 'XI TSM 3'),
(25, 'XII TSM 1'),
(26, 'XII TSM 2'),
(27, 'XII TSM 3');

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

--
-- Table structure for table `mapel`
--

CREATE TABLE `mapel` (
  `id` int(11) NOT NULL,
  `nama_mapel` varchar(100) NOT NULL,
  `kategori` varchar(100) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `kelas_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `mapel`
--

INSERT INTO `mapel` (`id`, `nama_mapel`, `kategori`, `guru_id`, `kelas_id`) VALUES
(19, 'Dasar Program Keahlian', 'Produktif TKR', 244, NULL),
(20, 'Mapel Fase Elemen F 1', 'Produktif TKR', 241, NULL),
(21, 'Mapel Fase Elemen F 2', 'Produktif TKR', 241, NULL),
(22, 'Mapel Fase Elemen F 3', 'Produktif TKR', 241, NULL),
(23, 'Pemeliharaan Mesin Kendaraan Ringan', 'Produktif TKR', 241, NULL),
(24, 'Pemeliharaan Sasis dan Pemindah Tenaga KR', 'Produktif TKR', 241, NULL),
(25, 'Pemeliharaan Kelistrikan KR', 'Produktif TKR', 244, NULL),
(26, 'Dasar Program Keahlian', 'Produktif TKJ', 247, NULL),
(27, 'Dasar Program Keahlian K3LH', 'Produktif TKJ', 79, NULL),
(28, 'Mapel Fase Elemen F 1', 'Produktif TKJ', 247, NULL),
(29, 'Mapel Fase Elemen F 2', 'Produktif TKJ', 247, NULL),
(30, 'Mapel Fase Elemen F 3', 'Produktif TKJ', 248, NULL),
(31, 'Administrasi Infrastruktur Jaringan', 'Produktif TKJ', 248, NULL),
(32, 'Administrasi Sistem Jaringan', 'Produktif TKJ', 248, NULL),
(33, 'Teknologi Layanan Jaringan', 'Produktif TKJ', 247, NULL),
(34, 'Dasar Program Keahlian', 'Produktif TSM', 259, NULL),
(35, 'Mapel Fase Elemen F 1', 'Produktif TSM', 259, NULL),
(36, 'Mapel Fase Elemen F 2', 'Produktif TSM', 259, NULL),
(37, 'Mapel Fase Elemen F 3', 'Umum', 250, NULL),
(38, 'Pemeliharaan Mesin Sepeda Motor', 'Produktif TSM', 250, NULL),
(39, 'Pemeliharaan Sasis SP', 'Produktif TSM', 250, NULL),
(40, 'Pemeliharaan Kelistrikan SP', 'Produktif TSM', 250, NULL),
(41, 'Pengelolaan Bengkel Sepeda Motor', 'Produktif TSM', 259, NULL),
(42, 'Pendidikan Agama dan Budi Pekerti', 'Umum', 242, NULL),
(43, 'Bahasa Arab', 'Umum', 255, NULL),
(44, 'Bahasa Arab', 'Umum', 251, NULL),
(45, 'Bahasa Indonesia', 'Umum', 245, NULL),
(46, 'Bahasa Indonesia', 'Umum', 252, NULL),
(47, 'Penjas Orkes', 'Umum', 249, NULL),
(48, 'Matematika', 'Umum', 240, NULL),
(49, 'Matematika', 'Umum', 256, NULL),
(50, 'Bahasa Inggris					', 'Umum', 257, NULL),
(51, 'Bahasa Inggris			', 'Umum', 253, NULL),
(52, 'Seni Budaya', 'Umum', 243, NULL),
(53, 'Produk Kreatif dan Kewirausahaan', 'Umum', 79, NULL),
(54, 'Produk Kreatif dan Kewirausahaan', 'Umum', 239, NULL),
(56, 'Pendidikan Pancasila dan Kewarganegaraan', 'Umum', 246, NULL),
(57, 'Pendidikan Pancasila dan Kewarganegaraan', 'Umum', 249, NULL),
(58, 'Pendidikan Pancasila dan Kewarganegaraan', 'Umum', 239, NULL),
(59, 'IPAS', 'Umum', 258, NULL),
(60, 'Sejarah Indonesia', 'Umum', 243, NULL),
(61, 'Sejarah Indonesia', 'Umum', 254, NULL),
(63, 'Informatika', 'Umum', 79, NULL);

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

--
-- Table structure for table `mapel_kelas`
--

CREATE TABLE `mapel_kelas` (
  `id` int(11) NOT NULL,
  `mapel_id` int(11) NOT NULL,
  `kelas_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `mapel_kelas`
--

INSERT INTO `mapel_kelas` (`id`, `mapel_id`, `kelas_id`) VALUES
(44, 19, 10),
(45, 19, 19),
(47, 21, 13),
(48, 22, 13),
(49, 23, 16),
(50, 24, 16),
(51, 25, 16),
(52, 26, 1),
(53, 27, 1),
(54, 28, 4),
(55, 29, 4),
(56, 30, 4),
(57, 31, 7),
(58, 32, 7),
(60, 34, 22),
(61, 35, 22),
(62, 36, 22),
(63, 37, 22),
(64, 38, 25),
(65, 39, 25),
(66, 40, 25),
(67, 41, 25),
(129, 56, 7),
(130, 56, 16),
(131, 56, 25),
(132, 57, 1),
(133, 57, 10),
(134, 57, 19),
(135, 58, 4),
(136, 58, 13),
(137, 58, 22),
(160, 46, 4),
(161, 46, 13),
(162, 46, 22),
(163, 61, 4),
(164, 61, 13),
(165, 61, 22),
(166, 60, 1),
(167, 60, 10),
(168, 60, 19),
(169, 59, 1),
(170, 59, 10),
(171, 59, 19),
(172, 54, 7),
(173, 54, 16),
(174, 54, 25),
(175, 53, 4),
(176, 53, 13),
(177, 53, 22),
(178, 52, 1),
(179, 52, 10),
(180, 52, 19),
(181, 51, 1),
(182, 51, 10),
(183, 51, 19),
(184, 51, 7),
(185, 51, 16),
(186, 51, 25),
(187, 50, 4),
(188, 50, 13),
(189, 50, 22),
(190, 49, 1),
(191, 49, 10),
(192, 49, 19),
(193, 48, 12),
(194, 48, 4),
(195, 48, 13),
(196, 48, 22),
(197, 48, 7),
(198, 48, 16),
(199, 48, 25),
(200, 47, 1),
(201, 47, 10),
(202, 47, 19),
(203, 47, 4),
(204, 47, 13),
(205, 47, 22),
(206, 45, 1),
(207, 45, 10),
(208, 45, 19),
(209, 45, 7),
(210, 45, 16),
(211, 45, 25),
(212, 44, 4),
(213, 44, 13),
(214, 44, 22),
(215, 43, 1),
(216, 43, 10),
(217, 43, 19),
(218, 42, 1),
(219, 42, 10),
(220, 42, 19),
(221, 42, 4),
(222, 42, 13),
(223, 42, 22),
(224, 42, 7),
(225, 42, 16),
(226, 42, 25),
(227, 33, 7),
(228, 20, 13),
(229, 63, 1),
(230, 63, 10),
(231, 63, 19);

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

--
-- Table structure for table `nilai`
--

CREATE TABLE `nilai` (
  `id` int(11) NOT NULL,
  `siswa_id` int(11) NOT NULL,
  `mapel_id` int(11) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `kelas_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jenis_penilaian` varchar(50) NOT NULL,
  `materi` varchar(100) DEFAULT NULL,
  `nilai` int(3) NOT NULL,
  `keterangan` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`) VALUES
(1, 'guru'),
(5, 'guru piket'),
(4, 'kepsek'),
(3, 'tata usaha'),
(2, 'wali kelas');

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

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

CREATE TABLE `siswa` (
  `id` int(11) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `nis` varchar(20) DEFAULT NULL,
  `kelas_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `siswa`
--

INSERT INTO `siswa` (`id`, `nama`, `nis`, `kelas_id`) VALUES
(54, 'ROKIM', '242510001', 13),
(55, 'Satria Sugito', '242510002', 13),
(56, 'Gusti Rifki', '242510003', 13),
(57, 'mohamad aenur ridho', '242510005', 13),
(58, 'HILMI NASHIRUDDIN', '242510006', 13),
(59, 'MUHAMMAD HUSNI', '242510007', 13),
(60, 'FADLI RAMDANI', '242510008', 13),
(61, 'ROY SAPUTRA', '242510009', 13),
(62, 'MOH. AL-QUFFRON', '242510010', 13),
(63, 'REHAN', '242510011', 13),
(64, 'KEVIN FEBRIYAN', '242510012', 13),
(65, 'MOH. ILHAM MULUDIN', '242510013', 13),
(66, 'RIZKI MAULANA', '242510060', 13),
(69, 'AZKA AMALINA', '242510014', 4),
(70, 'SUCI MUTIA ZAHRA', '242510015', 4),
(71, 'SALWA NURFADILA', '242510017', 4),
(72, 'FATHARANI PUTRI', '242510018', 1),
(73, 'MIRNA INDRAMAYANTI', '242510019', 4),
(74, 'RISA FEBRI YANTI', '242510020', 4),
(75, 'SONI ALFIANSYAH', '242510021', 4),
(76, 'WINDI AGUSTIN', '242510022', 4),
(77, 'SULISTIAWATI', '242510023', 4),
(78, 'ISMI NUR FADILAH', '242510024', 4),
(79, 'rima', '242510025', 4),
(80, 'ITSNA MAFAZA ARRAHMAH', '242510026', 4),
(81, 'safinah putri ramadani', '242510027', 4),
(82, 'LULU SYAFATUN NAZWA', '242510028', 4),
(83, 'RENCY LIYANA PUTRI', '242510029', 4),
(84, 'Subandi', '242510030', 4),
(85, 'MAYA APRILIYANI', '242510031', 4),
(86, 'FAQIH ADI HAMZAH', '242510032', 4),
(87, 'NATASYA ELIYANA SALSABILA', '242510033', 4),
(88, 'AMELISA MEILANI', '242510034', 4),
(89, 'NINING NURMALA', '242510035', 4),
(100, 'KHOERUL FAHMI', '242510036', 22),
(101, 'ANGGA PRAYOGA', '242510037', 22),
(102, 'SATRIA AWAL', '242510038', 22),
(103, 'Hafidon Rizki Maulana', '242510039', 22),
(104, 'MUHAMMAD GALANG ANUGRAH', '242510041', 22),
(105, 'HADI FIRMANSYAH', '242510043', 22),
(106, 'KADMA', '242510044', 22),
(107, 'RAFI', '242510045', 22),
(108, 'PUTRI DWI WULAN', '242510046', 22),
(109, 'RISFFA KIRANA AYU', '242510047', 22),
(110, 'Amru Fatir Pratama', '242510049', 22),
(111, 'Hermawan', '242510050', 22),
(112, 'AGENG INDRA FEBRIANDI', '242510051', 22),
(113, 'MUHAMMAD FATTAH', '242510052', 22),
(114, 'ARIF RAHMAN', '242510055', 22),
(115, 'Alifah fitriyanah', '242510056', 22),
(116, 'TASRIPIN', '242510053', 22),
(117, 'HERDY FEBRIYANTO', '242510058', 22),
(118, 'Fajar Maulana', '242510059', 22),
(131, 'A AGIM SAPUTRA', '232410001', 16),
(132, 'JULIANSYAH', '232410006', 16),
(133, 'M Asep Zulkifli', '232410007', 16),
(134, 'Muhammad Sartubaidilah', '232410008', 16),
(135, 'USMAN SETIAWAN YUSUP', '232410011', 16),
(136, 'TAUPIKHUROHMAN', '232410056', 16),
(138, 'AISYAH', '232410012', 7),
(139, 'AYU JASELA', '232410014', 7),
(140, 'BUNGAH CITRA LESTARI', '232410015', 7),
(141, 'CANTIKA NOVIYANTO', '232410016', 7),
(142, 'ELIS TIANI', '232410019', 7),
(143, 'LUKMAN ADLY', '232410024', 7),
(144, 'MILAH', '232410025', 7),
(145, 'Naura fakhira nurkholidah', '232410027', 7),
(146, 'NURFADILLA AWALLIYAH', '232410028', 7),
(147, 'Nur Fatmah', '232410029', 7),
(148, 'NUR INDAH SARI', '232410030', 7),
(149, 'Silviani Henadil Fatekha', '232410031', 7),
(150, 'SOLEHA', '232410032', 7),
(151, 'WIRO FALIS', '232410033', 7),
(152, 'NANDA MULYAMAH', '232410059', 7),
(153, 'MELINDA', '232410060', 7),
(154, 'RINI NURJAYANTI', '232410062', 7),
(155, 'MAWAR SARI', '232410063', 7),
(169, 'ADE FRAN ANDIKA', '232410035', 25),
(170, 'Ahmad Adib jain', '232410036', 25),
(171, 'ARYANTO', '232410038', 25),
(172, 'BAYU SAPUTRA', '232410039', 25),
(173, 'CASMANA', '232410040', 25),
(174, 'Denis Setiawan', '232410041', 25),
(175, 'DIMAS', '232410042', 25),
(176, 'FAISAL ROMADHON', '232410043', 25),
(177, 'FAYAZ MUMTAZ', '232410045', 25),
(178, 'FUJI NUGROHO', '232410046', 25),
(179, 'Kurnia Sandy', '232410047', 25),
(180, 'LAKI JUANG RAMADHAN', '232410048', 25),
(181, 'MIFTAHUL SAEBANI', '232410049', 25),
(182, 'MUHAMMAD ADIB', '232410050', 25),
(183, 'MUHAMAD RAFI', '232410051', 25),
(184, 'MUHAMAD RIZKI ', '232410052', 25),
(185, 'RESTU GUSTI ILLAHI', '232410053', 25),
(186, 'REZKY PERMANA', '232410054', 25),
(187, 'RIDHO MAULANA', '232410055', 25),
(188, 'TEDI ARDIANSAH', '232410057', 25),
(189, 'widi yandi', '232410058', 25);

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

--
-- Table structure for table `user_roles`
--

CREATE TABLE `user_roles` (
  `user_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_roles`
--

INSERT INTO `user_roles` (`user_id`, `role_id`) VALUES
(79, 1),
(79, 3),
(79, 5),
(239, 1),
(239, 2),
(240, 1),
(240, 2),
(241, 1),
(241, 2),
(242, 1),
(242, 2),
(242, 5),
(243, 1),
(243, 2),
(243, 5),
(244, 1),
(245, 1),
(245, 2),
(245, 5),
(246, 1),
(247, 1),
(247, 3),
(248, 1),
(248, 3),
(249, 1),
(249, 2),
(250, 1),
(251, 1),
(252, 1),
(252, 2),
(252, 5),
(253, 1),
(253, 2),
(254, 1),
(254, 5),
(255, 1),
(256, 1),
(257, 1),
(258, 1),
(258, 2),
(258, 5),
(259, 1),
(260, 4);

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

--
-- Table structure for table `wali_kelas`
--

CREATE TABLE `wali_kelas` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `kelas_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `wali_kelas`
--

INSERT INTO `wali_kelas` (`id`, `user_id`, `kelas_id`) VALUES
(91, 240, 22),
(92, 241, 16),
(93, 242, 7),
(94, 243, 10),
(95, 245, 8),
(96, 249, 13),
(97, 252, 4),
(98, 253, 19),
(99, 258, 1),
(100, 239, 25);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `absensi`
--
ALTER TABLE `absensi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `siswa_id` (`siswa_id`),
  ADD KEY `guru_id` (`guru_id`),
  ADD KEY `mapel_id` (`mapel_id`);

--
-- Indexes for table `absensi_guru`
--
ALTER TABLE `absensi_guru`
  ADD PRIMARY KEY (`id`),
  ADD KEY `guru_id` (`guru_id`);

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

--
-- Indexes for table `jadwal_guru`
--
ALTER TABLE `jadwal_guru`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_jadwal_guru_guru` (`guru_id`),
  ADD KEY `fk_jadwal_guru_kelas` (`kelas_id`),
  ADD KEY `fk_jadwal_guru_mapel` (`mapel_id`);

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

--
-- Indexes for table `mapel`
--
ALTER TABLE `mapel`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_mapel_kelas` (`kelas_id`);

--
-- Indexes for table `mapel_kelas`
--
ALTER TABLE `mapel_kelas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mapel_id` (`mapel_id`),
  ADD KEY `kelas_id` (`kelas_id`);

--
-- Indexes for table `nilai`
--
ALTER TABLE `nilai`
  ADD PRIMARY KEY (`id`),
  ADD KEY `siswa_id` (`siswa_id`),
  ADD KEY `mapel_id` (`mapel_id`),
  ADD KEY `guru_id` (`guru_id`),
  ADD KEY `kelas_id` (`kelas_id`);

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

--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_siswa_kelas` (`kelas_id`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `absensi`
--
ALTER TABLE `absensi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1125;

--
-- AUTO_INCREMENT for table `absensi_guru`
--
ALTER TABLE `absensi_guru`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=75;

--
-- AUTO_INCREMENT for table `agenda_harian`
--
ALTER TABLE `agenda_harian`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `jadwal_guru`
--
ALTER TABLE `jadwal_guru`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=129;

--
-- AUTO_INCREMENT for table `kelas`
--
ALTER TABLE `kelas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `mapel`
--
ALTER TABLE `mapel`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;

--
-- AUTO_INCREMENT for table `mapel_kelas`
--
ALTER TABLE `mapel_kelas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=232;

--
-- AUTO_INCREMENT for table `nilai`
--
ALTER TABLE `nilai`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=912;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `siswa`
--
ALTER TABLE `siswa`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=193;

--
-- AUTO_INCREMENT for table `wali_kelas`
--
ALTER TABLE `wali_kelas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `absensi`
--
ALTER TABLE `absensi`
  ADD CONSTRAINT `absensi_ibfk_1` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`),
  ADD CONSTRAINT `absensi_ibfk_3` FOREIGN KEY (`mapel_id`) REFERENCES `mapel` (`id`);

--
-- Constraints for table `absensi_guru`
--
ALTER TABLE `absensi_guru`
  ADD CONSTRAINT `absensi_guru_ibfk_1` FOREIGN KEY (`guru_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `jadwal_guru`
--
ALTER TABLE `jadwal_guru`
  ADD CONSTRAINT `fk_jadwal_guru_guru` FOREIGN KEY (`guru_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `fk_jadwal_guru_kelas` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`),
  ADD CONSTRAINT `fk_jadwal_guru_mapel` FOREIGN KEY (`mapel_id`) REFERENCES `mapel` (`id`),
  ADD CONSTRAINT `jadwal_guru_ibfk_1` FOREIGN KEY (`guru_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `mapel`
--
ALTER TABLE `mapel`
  ADD CONSTRAINT `fk_mapel_kelas` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`);

--
-- Constraints for table `mapel_kelas`
--
ALTER TABLE `mapel_kelas`
  ADD CONSTRAINT `mapel_kelas_ibfk_1` FOREIGN KEY (`mapel_id`) REFERENCES `mapel` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mapel_kelas_ibfk_2` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `nilai`
--
ALTER TABLE `nilai`
  ADD CONSTRAINT `nilai_ibfk_1` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `nilai_ibfk_2` FOREIGN KEY (`mapel_id`) REFERENCES `mapel` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `nilai_ibfk_3` FOREIGN KEY (`guru_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `nilai_ibfk_4` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `siswa`
--
ALTER TABLE `siswa`
  ADD CONSTRAINT `fk_siswa_kelas` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`);

--
-- Constraints for table `user_roles`
--
ALTER TABLE `user_roles`
  ADD CONSTRAINT `user_roles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `user_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

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

