text: -- phpMyAdmin SQL Dump
  -- version 4.9.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Sep 28, 2021 at 01:40 AM
  -- Server version: 10.4.8-MariaDB
  -- PHP Version: 7.3.10
  
  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: `codeigniter-krs`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `data_krs`
  --
  
  CREATE TABLE `data_krs` (
    `kode_krs` varchar(255) NOT NULL,
    `kode_mk` varchar(25) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `fakultas`
  --
  
  CREATE TABLE `fakultas` (
    `id` int(3) NOT NULL,
    `nama` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `fakultas`
  --
  
  INSERT INTO `fakultas` (`id`, `nama`) VALUES
  (1, 'Fakultas Ilmu komputer dan Teknologi Informasi'),
  (2, 'Fakultas Ekonomi');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `jurusan`
  --
  
  CREATE TABLE `jurusan` (
    `id` int(3) NOT NULL,
    `nama` varchar(100) NOT NULL,
    `fakultas_id` int(3) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `jurusan`
  --
  
  INSERT INTO `jurusan` (`id`, `nama`, `fakultas_id`) VALUES
  (1, 'Sistem Informasi', 1),
  (2, 'Sistem Komputer', 1),
  (3, 'Akuntansi', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `krs`
  --
  
  CREATE TABLE `krs` (
    `kode_krs` varchar(255) NOT NULL,
    `npm` varchar(8) NOT NULL DEFAULT '0',
    `total_sks` int(3) NOT NULL DEFAULT 0,
    `semester` int(1) NOT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `mahasiswa`
  --
  
  CREATE TABLE `mahasiswa` (
    `npm` varchar(8) NOT NULL,
    `nama` varchar(50) NOT NULL DEFAULT '0',
    `kelas` varchar(6) DEFAULT NULL,
    `jurusan_id` int(3) DEFAULT NULL,
    `semester` int(1) NOT NULL,
    `user_id` int(11) NOT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `mahasiswa`
  --
  
  INSERT INTO `mahasiswa` (`npm`, `nama`, `kelas`, `jurusan_id`, `semester`, `user_id`) VALUES
  ('00000001', 'Bayu Anugerah1', '4KA011', 1, 81, 5),
  ('00000002', 'IRFAN ANDREA IRAWANTI', '4KA01', 2, 1, 6);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `matakuliah`
  --
  
  CREATE TABLE `matakuliah` (
    `kode_mk` varchar(10) NOT NULL,
    `nama` varchar(50) NOT NULL DEFAULT '0',
    `semester` enum('ATA','PTA') NOT NULL,
    `sks` int(2) DEFAULT NULL,
    `jurusan_id` int(3) NOT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `matakuliah`
  --
  
  INSERT INTO `matakuliah` (`kode_mk`, `nama`, `semester`, `sks`, `jurusan_id`) VALUES
  ('IT000207', 'Robotika', 'ATA', 2, 1),
  ('IT000208', 'Ekonomi', 'PTA', 5, 3),
  ('IT0002073', 'Dotaa', 'ATA', 2, 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE `user` (
    `id` int(11) NOT NULL,
    `username` varchar(35) NOT NULL,
    `email` varchar(100) NOT NULL,
    `password` varchar(255) NOT NULL,
    `role` enum('mahasiswa','admin') NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user`
  --
  
  INSERT INTO `user` (`id`, `username`, `email`, `password`, `role`) VALUES
  (1, 'admin', 'admin', 'admin123', 'admin'),
  (5, 'wonderkid1', 'bayu.anugerah99@gmail.com', 'wonderkid1234', 'mahasiswa'),
  (6, 'escanor', 'bayu.anugerah1@gmail.com', 'escanor123', 'mahasiswa');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `fakultas`
  --
  ALTER TABLE `fakultas`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `jurusan`
  --
  ALTER TABLE `jurusan`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `krs`
  --
  ALTER TABLE `krs`
    ADD PRIMARY KEY (`kode_krs`);
  
  --
  -- Indexes for table `mahasiswa`
  --
  ALTER TABLE `mahasiswa`
    ADD PRIMARY KEY (`npm`);
  
  --
  -- Indexes for table `matakuliah`
  --
  ALTER TABLE `matakuliah`
    ADD PRIMARY KEY (`kode_mk`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `fakultas`
  --
  ALTER TABLE `fakultas`
    MODIFY `id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `jurusan`
  --
  ALTER TABLE `jurusan`
    MODIFY `id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  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 */;
  