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

START TRANSACTION;



--
-- Database: `database3`
--

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

--
-- Table structure for table `barang`
--

CREATE TABLE `barang` (
  `id_barang` int(11) NOT NULL,
  `nama` varchar(50) NOT NULL,
  `harga` int(11) NOT NULL,
  `jumlah` int(11) NOT NULL,
  `kode_barang` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `barang`
--

INSERT INTO `barang` (`id_barang`, `nama`, `harga`, `jumlah`, `kode_barang`) VALUES
(1, 'Bola Basket Besar', 60000, 10, 'B0059'),
(2, 'Sabun Mandi', 2500, 10, 'B0057'),
(3, 'Pasta Gigi', 2000, 20, 'B0055'),
(4, 'Sampoo Botol 350ml', 16000, 10, 'B0054'),
(5, 'Balsem ', 5000, 10, 'B0053'),
(6, 'Sapu Lidi', 10000, 10, 'B0056'),
(7, 'Sandal ', 12000, 10, 'B0052'),
(8, 'Minyak', 22000, 10, 'B0051'),
(9, 'Salak Buah', 5000, 10, 'B0040'),
(10, 'Lampu Lilin', 10000, 10, 'B0088'),
(11, 'Sabun Mandi Cair', 7000, 3, 'B0034');

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

--
-- Table structure for table `disbarang`
--

CREATE TABLE `disbarang` (
  `id` int(11) UNSIGNED NOT NULL,
  `barang_id` int(11) DEFAULT NULL,
  `qty` int(11) DEFAULT NULL,
  `potongan` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `disbarang`
--

INSERT INTO `disbarang` (`id`, `barang_id`, `qty`, `potongan`) VALUES
(1, 3, 5, 2000),
(3, 7, 10, 5000);

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

--
-- Table structure for table `role`
--

CREATE TABLE `role` (
  `id_role` int(11) NOT NULL,
  `nama` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `role`
--

INSERT INTO `role` (`id_role`, `nama`) VALUES
(1, 'Admin'),
(2, 'Kasir');

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

--
-- Table structure for table `transaksi`
--

CREATE TABLE `transaksi` (
  `id_transaksi` int(11) NOT NULL,
  `tanggal_waktu` datetime NOT NULL,
  `nomor` varchar(20) NOT NULL,
  `total` int(11) NOT NULL,
  `nama` varchar(50) NOT NULL,
  `bayar` int(11) NOT NULL,
  `kembali` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `transaksi`
--

INSERT INTO `transaksi` (`id_transaksi`, `tanggal_waktu`, `nomor`, `total`, `nama`, `bayar`, `kembali`) VALUES
(8, '2020-02-25 16:05:22', '734687', 84000, 'Novia Pramudia', 100000, 16000),
(9, '2020-02-25 16:37:31', '237413', 52000, 'Novia Pramudia', 60000, 8000),
(10, '2020-07-02 06:28:53', '311124', 12000, 'Novia Pramudia', 15000, 3000),
(11, '2020-07-02 06:37:11', '123793', 14000, 'Novia Pramudia', 15000, 1000);

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

--
-- Table structure for table `transaksi_detail`
--

CREATE TABLE `transaksi_detail` (
  `id_transaksi_detail` int(11) NOT NULL,
  `id_transaksi` int(11) NOT NULL,
  `id_barang` int(11) NOT NULL,
  `harga` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `total` int(11) NOT NULL,
  `diskon` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `transaksi_detail`
--

INSERT INTO `transaksi_detail` (`id_transaksi_detail`, `id_transaksi`, `id_barang`, `harga`, `qty`, `total`, `diskon`) VALUES
(24, 8, 3, 2000, 5, 10000, 2000),
(25, 8, 4, 16000, 1, 16000, 0),
(26, 8, 1, 60000, 1, 60000, 0),
(27, 9, 3, 2000, 10, 20000, 4000),
(28, 9, 6, 10000, 2, 20000, 0),
(29, 9, 4, 16000, 1, 16000, 0),
(30, 10, 3, 2000, 1, 2000, 0),
(31, 10, 6, 10000, 1, 10000, 0),
(32, 11, 3, 2000, 2, 4000, 0),
(33, 11, 6, 10000, 1, 10000, 0);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `barang`
--
ALTER TABLE `barang`
  ADD PRIMARY KEY (`id_barang`);

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

--
-- Indexes for table `role`
--
ALTER TABLE `role`
  ADD PRIMARY KEY (`id_role`);

--
-- Indexes for table `transaksi`
--
ALTER TABLE `transaksi`
  ADD PRIMARY KEY (`id_transaksi`);

--
-- Indexes for table `transaksi_detail`
--
ALTER TABLE `transaksi_detail`
  ADD PRIMARY KEY (`id_transaksi_detail`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `barang`
--
ALTER TABLE `barang`
  MODIFY `id_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `disbarang`
--
ALTER TABLE `disbarang`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
  MODIFY `id_role` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `transaksi`
--
ALTER TABLE `transaksi`
  MODIFY `id_transaksi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `transaksi_detail`
--
ALTER TABLE `transaksi_detail`
  MODIFY `id_transaksi_detail` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
COMMIT;

