text: -- phpMyAdmin SQL Dump
  -- version 4.8.3
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Jan 04, 2019 at 10:19 AM
  -- Server version: 10.1.37-MariaDB
  -- PHP Version: 7.2.12
  
  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_barang`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `data_barang`
  --
  
  CREATE TABLE `data_barang` (
    `id_barang` int(11) NOT NULL,
    `nama_barang` varchar(30) NOT NULL,
    `stok` int(11) NOT NULL,
    `kategori_id` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `data_barang`
  --
  
  INSERT INTO `data_barang` (`id_barang`, `nama_barang`, `stok`, `kategori_id`) VALUES
  (5, 'iMAC', 1, 1),
  (6, 'Xiamoi Redmi 4', 1, 1),
  (8, 'iPhone', 12, 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori`
  --
  
  CREATE TABLE `kategori` (
    `id_kategori` int(11) NOT NULL,
    `kategori_barang` varchar(30) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `kategori`
  --
  
  INSERT INTO `kategori` (`id_kategori`, `kategori_barang`) VALUES
  (1, 'Elektronik'),
  (2, 'Kebersihan'),
  (3, 'Buku');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `data_barang`
  --
  ALTER TABLE `data_barang`
    ADD PRIMARY KEY (`id_barang`),
    ADD KEY `id_kategori` (`kategori_id`);
  
  --
  -- Indexes for table `kategori`
  --
  ALTER TABLE `kategori`
    ADD PRIMARY KEY (`id_kategori`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `data_barang`
  --
  ALTER TABLE `data_barang`
    MODIFY `id_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  
  --
  -- AUTO_INCREMENT for table `kategori`
  --
  ALTER TABLE `kategori`
    MODIFY `id_kategori` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `data_barang`
  --
  ALTER TABLE `data_barang`
    ADD CONSTRAINT `data_barang_ibfk_1` FOREIGN KEY (`kategori_id`) REFERENCES `kategori` (`id_kategori`) ON DELETE CASCADE ON UPDATE CASCADE;
  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 */;
  