-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 12, 2021 at 04:04 AM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; 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: `ci_online_test` -- -- -------------------------------------------------------- -- -- Table structure for table `dosen` -- CREATE TABLE `dosen` ( `id_dosen` int(11) NOT NULL, `nip` char(12) NOT NULL, `nama_dosen` varchar(50) NOT NULL, `email` varchar(254) NOT NULL, `matkul_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `dosen` -- INSERT INTO `dosen` (`id_dosen`, `nip`, `nama_dosen`, `email`, `matkul_id`) VALUES (1, '00000001', 'pengujiAnalogy', 'pAnalogy@unla.com', 1), (2, '00000002', 'pengujiLogicReason', 'pLogicReason@unla.com', 2); -- -- Triggers `dosen` -- DELIMITER $$ CREATE TRIGGER `edit_user_dosen` BEFORE UPDATE ON `dosen` FOR EACH ROW UPDATE `users` SET `email` = NEW.email, `username` = NEW.nip WHERE `users`.`username` = OLD.nip $$ DELIMITER ; DELIMITER $$ CREATE TRIGGER `hapus_user_dosen` BEFORE DELETE ON `dosen` FOR EACH ROW DELETE FROM `users` WHERE `users`.`username` = OLD.nip $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `groups` -- CREATE TABLE `groups` ( `id` mediumint(8) UNSIGNED NOT NULL, `name` varchar(20) NOT NULL, `description` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `groups` -- INSERT INTO `groups` (`id`, `name`, `description`) VALUES (1, 'admin', 'Administrator'), (2, 'dosen', 'Pembuat Soal dan ujian'), (3, 'mahasiswa', 'Peserta Ujian'); -- -------------------------------------------------------- -- -- Table structure for table `h_ujian` -- CREATE TABLE `h_ujian` ( `id` int(11) NOT NULL, `ujian_id` int(11) NOT NULL, `mahasiswa_id` int(11) NOT NULL, `list_soal` longtext NOT NULL, `list_jawaban` longtext NOT NULL, `jml_benar` int(11) NOT NULL, `nilai` decimal(10,2) NOT NULL, `nilai_bobot` decimal(10,2) NOT NULL, `tgl_mulai` datetime NOT NULL, `tgl_selesai` datetime NOT NULL, `status` enum('Y','N') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `h_ujian` -- INSERT INTO `h_ujian` (`id`, `ujian_id`, `mahasiswa_id`, `list_soal`, `list_jawaban`, `jml_benar`, `nilai`, `nilai_bobot`, `tgl_mulai`, `tgl_selesai`, `status`) VALUES (1, 1, 1, '2,3,1', '2:C:N,3:B:N,1:B:N', 2, '66.00', '1.00', '2021-03-11 18:30:09', '2021-03-11 20:30:09', 'N'); -- -------------------------------------------------------- -- -- Table structure for table `jurusan` -- CREATE TABLE `jurusan` ( `id_jurusan` int(11) NOT NULL, `nama_jurusan` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `jurusan` -- INSERT INTO `jurusan` (`id_jurusan`, `nama_jurusan`) VALUES (1, 'TPA'); -- -------------------------------------------------------- -- -- Table structure for table `jurusan_matkul` -- CREATE TABLE `jurusan_matkul` ( `id` int(11) NOT NULL, `matkul_id` int(11) NOT NULL, `jurusan_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `jurusan_matkul` -- INSERT INTO `jurusan_matkul` (`id`, `matkul_id`, `jurusan_id`) VALUES (1, 1, 1), (2, 2, 1), (3, 3, 1), (4, 4, 1), (5, 5, 1), (6, 6, 1), (7, 7, 1), (8, 8, 1); -- -------------------------------------------------------- -- -- Table structure for table `kelas` -- CREATE TABLE `kelas` ( `id_kelas` int(11) NOT NULL, `nama_kelas` varchar(30) NOT NULL, `jurusan_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `kelas` -- INSERT INTO `kelas` (`id_kelas`, `nama_kelas`, `jurusan_id`) VALUES (1, 'Verbal', 1), (2, 'Numerikal', 1), (3, 'Figural', 1); -- -------------------------------------------------------- -- -- Table structure for table `kelas_dosen` -- CREATE TABLE `kelas_dosen` ( `id` int(11) NOT NULL, `kelas_id` int(11) NOT NULL, `dosen_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `kelas_dosen` -- INSERT INTO `kelas_dosen` (`id`, `kelas_id`, `dosen_id`) VALUES (1, 3, 1), (2, 2, 1), (3, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `login_attempts` -- CREATE TABLE `login_attempts` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `login` varchar(100) NOT NULL, `time` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `mahasiswa` -- CREATE TABLE `mahasiswa` ( `id_mahasiswa` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `nim` char(20) NOT NULL, `email` varchar(254) NOT NULL, `jenis_kelamin` enum('L','P') NOT NULL, `kelas_id` int(11) NOT NULL COMMENT 'kelas&jurusan' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `mahasiswa` -- INSERT INTO `mahasiswa` (`id_mahasiswa`, `nama`, `nim`, `email`, `jenis_kelamin`, `kelas_id`) VALUES (1, 'Peserta01', '00001001', 'peserta01@unla.com', 'L', 1); -- -------------------------------------------------------- -- -- Table structure for table `matkul` -- CREATE TABLE `matkul` ( `id_matkul` int(11) NOT NULL, `nama_matkul` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `matkul` -- INSERT INTO `matkul` (`id_matkul`, `nama_matkul`) VALUES (1, 'Analogy'), (2, 'Logical Reasoning'), (3, 'Analytical Reasoning'), (4, 'Aritmethic'), (5, 'Number Series'), (6, 'Word Problem'), (7, 'Figur Analysis and Sinthesis'), (8, 'Spatial Reasoning'); -- -------------------------------------------------------- -- -- Table structure for table `m_ujian` -- CREATE TABLE `m_ujian` ( `id_ujian` int(11) NOT NULL, `dosen_id` int(11) NOT NULL, `matkul_id` int(11) NOT NULL, `nama_ujian` varchar(200) NOT NULL, `jumlah_soal` int(11) NOT NULL, `waktu` int(11) NOT NULL, `jenis` enum('acak','urut') NOT NULL, `tgl_mulai` datetime NOT NULL, `terlambat` datetime NOT NULL, `token` varchar(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `m_ujian` -- INSERT INTO `m_ujian` (`id_ujian`, `dosen_id`, `matkul_id`, `nama_ujian`, `jumlah_soal`, `waktu`, `jenis`, `tgl_mulai`, `terlambat`, `token`) VALUES (1, 1, 1, 'Tes Analogy 1', 3, 120, 'acak', '2021-03-11 18:09:51', '2021-03-25 18:09:53', 'DTXUR'); -- -------------------------------------------------------- -- -- Table structure for table `tb_soal` -- CREATE TABLE `tb_soal` ( `id_soal` int(11) NOT NULL, `dosen_id` int(11) NOT NULL, `matkul_id` int(11) NOT NULL, `bobot` int(11) NOT NULL, `file` varchar(255) NOT NULL, `tipe_file` varchar(50) NOT NULL, `soal` longtext NOT NULL, `opsi_a` longtext NOT NULL, `opsi_b` longtext NOT NULL, `opsi_c` longtext NOT NULL, `opsi_d` longtext NOT NULL, `opsi_e` longtext NOT NULL, `file_a` varchar(255) NOT NULL, `file_b` varchar(255) NOT NULL, `file_c` varchar(255) NOT NULL, `file_d` varchar(255) NOT NULL, `file_e` varchar(255) NOT NULL, `jawaban` varchar(5) NOT NULL, `created_on` int(11) NOT NULL, `updated_on` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `tb_soal` -- INSERT INTO `tb_soal` (`id_soal`, `dosen_id`, `matkul_id`, `bobot`, `file`, `tipe_file`, `soal`, `opsi_a`, `opsi_b`, `opsi_c`, `opsi_d`, `opsi_e`, `file_a`, `file_b`, `file_c`, `file_d`, `file_e`, `jawaban`, `created_on`, `updated_on`) VALUES (1, 1, 1, 10, '', '', '
Tes Soal 1
', '1
', '2
', '3
', '4
', '5
', '', '', '', '', '', 'B', 1615460857, 1615460857), (2, 1, 1, 10, '', '', 'Soal 2
', '1
', '2
', '3
', '4
', '5
', '', '', '', '', '', 'C', 1615460918, 1615460918), (3, 1, 1, 10, '', '', 'Tes Soal 3
', '1
', '2
', '3
', '4
', '5
', '', '', '', '', '', 'D', 1615460940, 1615460940); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `ip_address` varchar(45) NOT NULL, `username` varchar(100) DEFAULT NULL, `password` varchar(255) NOT NULL, `email` varchar(254) DEFAULT NULL, `activation_selector` varchar(255) DEFAULT NULL, `activation_code` varchar(255) DEFAULT NULL, `forgotten_password_selector` varchar(255) DEFAULT NULL, `forgotten_password_code` varchar(255) DEFAULT NULL, `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL, `remember_selector` varchar(255) DEFAULT NULL, `remember_code` varchar(255) DEFAULT NULL, `created_on` int(11) UNSIGNED NOT NULL, `last_login` int(11) UNSIGNED DEFAULT NULL, `active` tinyint(1) UNSIGNED DEFAULT NULL, `first_name` varchar(50) DEFAULT NULL, `last_name` varchar(50) DEFAULT NULL, `company` varchar(100) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `email`, `activation_selector`, `activation_code`, `forgotten_password_selector`, `forgotten_password_code`, `forgotten_password_time`, `remember_selector`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES (1, '127.0.0.1', 'Administrator', '$2y$12$tGY.AtcyXrh7WmccdbT1rOuKEcTsKH6sIUmDr0ore1yN4LnKTTtuu', 'admin@admin.com', NULL, '', NULL, NULL, NULL, NULL, NULL, 1268889823, 1615513612, 1, 'Admin', 'Istrator', 'ADMIN', '0'), (12, '::1', '00000001', '$2y$10$7tnpmUZyuTK8TkIvr66hjO4b7Mj9aIRgvh.LOOsuYUaiKR.hB4Di.', 'pAnalogy@unla.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1615460751, 1615462087, 1, 'penguji01', 'penguji01', NULL, NULL), (13, '::1', '00001001', '$2y$10$pDHE4hI4sjkiQKQHQ4kicetTwaS7U8VyUsNfllAQmZLLfukuXMWM2', 'peserta01@unla.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1615460783, 1615462198, 1, 'Peserta01', 'Peserta01', NULL, NULL), (14, '::1', '00000002', '$2y$10$PG1r1BIVDs1S8obeOjSD2uhB6CqGp5FZNMCIFMe1FPJW68Uj/Vh/u', 'pLogicReason@unla.com', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1615518159, NULL, 1, 'pengujiLogicReason', 'pengujiLogicReason', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `users_groups` -- CREATE TABLE `users_groups` ( `id` int(11) UNSIGNED NOT NULL, `user_id` int(11) UNSIGNED NOT NULL, `group_id` mediumint(8) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_groups` -- INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES (3, 1, 1), (14, 12, 2), (15, 13, 3), (16, 14, 2); -- -------------------------------------------------------- -- -- Table structure for table `waktu_soal` -- CREATE TABLE `waktu_soal` ( `id_waktu_soal` int(11) NOT NULL, `id_mahasiswa` varchar(50) NOT NULL, `id_ujian` int(100) NOT NULL, `id_soal` varchar(50) NOT NULL, `urutan` int(11) NOT NULL, `waktu` int(11) NOT NULL, `status_jawaban` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `waktu_soal` -- INSERT INTO `waktu_soal` (`id_waktu_soal`, `id_mahasiswa`, `id_ujian`, `id_soal`, `urutan`, `waktu`, `status_jawaban`) VALUES (15, '3', 0, 'tes_id_soal', 1, 2, ''), (16, '3', 0, '2', 1, 2, ''), (17, '3', 0, 'tes', 1, 2, ''), (18, '3', 0, 'tes', 1, 2, ''), (19, '3', 0, 'tes', 1, 2, ''), (20, '3', 0, 'tes', 1, 2, ''), (21, '3', 0, 'tes', 1, 2, ''), (22, '3', 0, 'tes', 1, 2, ''), (23, '3', 0, 'tes', 1, 2, ''), (24, '3', 0, 'tes', 1, 2, ''), (25, '3', 0, 'tes', 1, 2, ''), (26, '3', 0, 'tes', 1, 2, ''), (27, '3', 0, 'tes', 1, 2, ''), (28, '3', 0, 'tes', 1, 2, ''), (29, 'tes_id_mahasiswa', 0, 'tes', 1, 2, ''), (30, 'tes_id_mahasiswa', 0, 'tes', 1, 1, ''), (31, '3', 0, 'tes', 1, 1, ''), (32, '3', 0, '5', 1, 2, ''), (33, '3', 0, '5', 1, 148, ''), (34, '3', 0, ',', 2, 76, ''), (35, '3', 0, '6', 3, 5, ''), (36, '3', 0, '', 4, 39, ''), (37, '3', 7, '5', 1, 9, 'tes'), (38, '3', 8, '5', 1, 11, 'tes'), (39, '3', 8, '5', 1, 5, 'tes'), (40, '3', 8, ',', 2, 153, 'tes'), (41, '3', 9, '3', 1, 9, 'tes'), (42, '3', 9, ',', 2, 6, 'tes'), (43, '3', 9, '1', 3, 181, 'tes'), (44, '3', 9, ',', 4, 898, 'tes'), (45, '3', 9, '3', 1, 74, 'tes'), (46, '3', 9, '3', 1, 2, 'tes'), (47, '3', 9, '3', 1, 1, 'tes'), (48, '3', 9, '3', 1, 0, 'tes'), (49, '3', 9, '3', 1, 73, 'tes'), (50, '3', 9, ',', 2, 245, 'tes'), (51, '1', 1, '2', 1, 9, 'tes'), (52, '1', 1, ',', 2, 39, 'tes'), (53, '1', 1, '2', 1, 1, 'tes'); -- -- Indexes for dumped tables -- -- -- Indexes for table `dosen` -- ALTER TABLE `dosen` ADD PRIMARY KEY (`id_dosen`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `nip` (`nip`), ADD KEY `matkul_id` (`matkul_id`); -- -- Indexes for table `groups` -- ALTER TABLE `groups` ADD PRIMARY KEY (`id`); -- -- Indexes for table `h_ujian` -- ALTER TABLE `h_ujian` ADD PRIMARY KEY (`id`), ADD KEY `ujian_id` (`ujian_id`), ADD KEY `mahasiswa_id` (`mahasiswa_id`); -- -- Indexes for table `jurusan` -- ALTER TABLE `jurusan` ADD PRIMARY KEY (`id_jurusan`); -- -- Indexes for table `jurusan_matkul` -- ALTER TABLE `jurusan_matkul` ADD PRIMARY KEY (`id`), ADD KEY `jurusan_id` (`jurusan_id`), ADD KEY `matkul_id` (`matkul_id`); -- -- Indexes for table `kelas` -- ALTER TABLE `kelas` ADD PRIMARY KEY (`id_kelas`), ADD KEY `jurusan_id` (`jurusan_id`); -- -- Indexes for table `kelas_dosen` -- ALTER TABLE `kelas_dosen` ADD PRIMARY KEY (`id`), ADD KEY `kelas_id` (`kelas_id`), ADD KEY `dosen_id` (`dosen_id`); -- -- Indexes for table `login_attempts` -- ALTER TABLE `login_attempts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `mahasiswa` -- ALTER TABLE `mahasiswa` ADD PRIMARY KEY (`id_mahasiswa`), ADD UNIQUE KEY `nim` (`nim`), ADD UNIQUE KEY `email` (`email`), ADD KEY `kelas_id` (`kelas_id`); -- -- Indexes for table `matkul` -- ALTER TABLE `matkul` ADD PRIMARY KEY (`id_matkul`); -- -- Indexes for table `m_ujian` -- ALTER TABLE `m_ujian` ADD PRIMARY KEY (`id_ujian`), ADD KEY `matkul_id` (`matkul_id`), ADD KEY `dosen_id` (`dosen_id`); -- -- Indexes for table `tb_soal` -- ALTER TABLE `tb_soal` ADD PRIMARY KEY (`id_soal`), ADD KEY `matkul_id` (`matkul_id`), ADD KEY `dosen_id` (`dosen_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_activation_selector` (`activation_selector`), ADD UNIQUE KEY `uc_forgotten_password_selector` (`forgotten_password_selector`), ADD UNIQUE KEY `uc_remember_selector` (`remember_selector`), ADD UNIQUE KEY `uc_email` (`email`) USING BTREE; -- -- Indexes for table `users_groups` -- ALTER TABLE `users_groups` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`), ADD KEY `fk_users_groups_users1_idx` (`user_id`), ADD KEY `fk_users_groups_groups1_idx` (`group_id`); -- -- Indexes for table `waktu_soal` -- ALTER TABLE `waktu_soal` ADD PRIMARY KEY (`id_waktu_soal`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `dosen` -- ALTER TABLE `dosen` MODIFY `id_dosen` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `groups` -- ALTER TABLE `groups` MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `h_ujian` -- ALTER TABLE `h_ujian` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `jurusan` -- ALTER TABLE `jurusan` MODIFY `id_jurusan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `jurusan_matkul` -- ALTER TABLE `jurusan_matkul` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `kelas` -- ALTER TABLE `kelas` MODIFY `id_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `kelas_dosen` -- ALTER TABLE `kelas_dosen` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `login_attempts` -- ALTER TABLE `login_attempts` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `mahasiswa` -- ALTER TABLE `mahasiswa` MODIFY `id_mahasiswa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `matkul` -- ALTER TABLE `matkul` MODIFY `id_matkul` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `m_ujian` -- ALTER TABLE `m_ujian` MODIFY `id_ujian` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_soal` -- ALTER TABLE `tb_soal` MODIFY `id_soal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `users_groups` -- ALTER TABLE `users_groups` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `waktu_soal` -- ALTER TABLE `waktu_soal` MODIFY `id_waktu_soal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54; -- -- Constraints for dumped tables -- -- -- Constraints for table `dosen` -- ALTER TABLE `dosen` ADD CONSTRAINT `dosen_ibfk_1` FOREIGN KEY (`matkul_id`) REFERENCES `matkul` (`id_matkul`); -- -- Constraints for table `h_ujian` -- ALTER TABLE `h_ujian` ADD CONSTRAINT `h_ujian_ibfk_1` FOREIGN KEY (`ujian_id`) REFERENCES `m_ujian` (`id_ujian`), ADD CONSTRAINT `h_ujian_ibfk_2` FOREIGN KEY (`mahasiswa_id`) REFERENCES `mahasiswa` (`id_mahasiswa`); -- -- Constraints for table `jurusan_matkul` -- ALTER TABLE `jurusan_matkul` ADD CONSTRAINT `jurusan_matkul_ibfk_1` FOREIGN KEY (`jurusan_id`) REFERENCES `jurusan` (`id_jurusan`), ADD CONSTRAINT `jurusan_matkul_ibfk_2` FOREIGN KEY (`matkul_id`) REFERENCES `matkul` (`id_matkul`); -- -- Constraints for table `kelas_dosen` -- ALTER TABLE `kelas_dosen` ADD CONSTRAINT `kelas_dosen_ibfk_1` FOREIGN KEY (`dosen_id`) REFERENCES `dosen` (`id_dosen`), ADD CONSTRAINT `kelas_dosen_ibfk_2` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id_kelas`); -- -- Constraints for table `mahasiswa` -- ALTER TABLE `mahasiswa` ADD CONSTRAINT `mahasiswa_ibfk_2` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id_kelas`); -- -- Constraints for table `m_ujian` -- ALTER TABLE `m_ujian` ADD CONSTRAINT `m_ujian_ibfk_1` FOREIGN KEY (`dosen_id`) REFERENCES `dosen` (`id_dosen`), ADD CONSTRAINT `m_ujian_ibfk_2` FOREIGN KEY (`matkul_id`) REFERENCES `matkul` (`id_matkul`); -- -- Constraints for table `tb_soal` -- ALTER TABLE `tb_soal` ADD CONSTRAINT `tb_soal_ibfk_1` FOREIGN KEY (`matkul_id`) REFERENCES `matkul` (`id_matkul`), ADD CONSTRAINT `tb_soal_ibfk_2` FOREIGN KEY (`dosen_id`) REFERENCES `dosen` (`id_dosen`); -- -- Constraints for table `users_groups` -- ALTER TABLE `users_groups` ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; 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 */;