-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_siventrol.sql
210 lines (167 loc) · 5.41 KB
/
db_siventrol.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 09 Jan 2024 pada 17.11
-- Versi server: 10.4.27-MariaDB
-- Versi PHP: 7.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `db_siventrol`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_barang`
--
CREATE TABLE `tb_barang` (
`id_barang` varchar(10) NOT NULL,
`nama_barang` varchar(50) NOT NULL,
`unit` varchar(5) NOT NULL,
`harga_beli` varchar(50) NOT NULL,
`harga_jual` varchar(50) NOT NULL,
`diskon` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data untuk tabel `tb_barang`
--
INSERT INTO `tb_barang` (`id_barang`, `nama_barang`, `unit`, `harga_beli`, `harga_jual`, `diskon`) VALUES
('BRG-1', 'HP Samsung A5', 'pcs', '4500000', '5000000', '0'),
('BRG-2', 'Indomie Goreng', 'pcs', '3000', '3500', '0');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_barang_masuk`
--
CREATE TABLE `tb_barang_masuk` (
`id_brg_msk` varchar(10) NOT NULL,
`tgl_transaksi_bm` date NOT NULL,
`id_supplier` varchar(10) NOT NULL,
`tot_harga_bm` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data untuk tabel `tb_barang_masuk`
--
INSERT INTO `tb_barang_masuk` (`id_brg_msk`, `tgl_transaksi_bm`, `id_supplier`, `tot_harga_bm`) VALUES
('BM-1', '2024-01-09', 'SPL-1', '4,506,000');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_det_brg_msk`
--
CREATE TABLE `tb_det_brg_msk` (
`id_det_brg_msk` int(10) NOT NULL,
`id_brg_msk` varchar(10) NOT NULL,
`id_barang` varchar(10) NOT NULL,
`qty_masuk` int(10) NOT NULL,
`status_bm` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data untuk tabel `tb_det_brg_msk`
--
INSERT INTO `tb_det_brg_msk` (`id_det_brg_msk`, `id_brg_msk`, `id_barang`, `qty_masuk`, `status_bm`) VALUES
(3, 'BM-1', 'BRG-1', 1, 1),
(4, 'BM-1', 'BRG-2', 2, 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_pelanggan`
--
CREATE TABLE `tb_pelanggan` (
`id_pelanggan` varchar(10) NOT NULL,
`nama_pelanggan` varchar(50) NOT NULL,
`alamat_pelanggan` varchar(50) NOT NULL,
`kota_pelanggan` varchar(25) NOT NULL,
`email_pelanggan` varchar(25) NOT NULL,
`kontak_pelanggan` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_supplier`
--
CREATE TABLE `tb_supplier` (
`id_supplier` varchar(10) NOT NULL,
`nama_supplier` varchar(50) NOT NULL,
`alamat_supplier` varchar(50) NOT NULL,
`kota_supplier` varchar(25) NOT NULL,
`email_supplier` varchar(25) NOT NULL,
`kontak_supplier` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data untuk tabel `tb_supplier`
--
INSERT INTO `tb_supplier` (`id_supplier`, `nama_supplier`, `alamat_supplier`, `kota_supplier`, `email_supplier`, `kontak_supplier`) VALUES
('SPL-1', 'Wanda', 'Jl. Sungai Miai', 'BJM', '[email protected]', '0896152637163');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_user`
--
CREATE TABLE `tb_user` (
`id_user` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`nama_lengkap` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`level` tinyint(4) NOT NULL,
`last_login` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
--
-- Dumping data untuk tabel `tb_user`
--
INSERT INTO `tb_user` (`id_user`, `username`, `nama_lengkap`, `password`, `level`, `last_login`) VALUES
(1, 'admin', 'Admin', '$2y$10$IzLuU6uxyHkApMWHK.TinuHPi1bfF1ty1H/X5RqJ5V545b4gvz9sW', 0, '2024-01-09 21:49:34');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `tb_barang`
--
ALTER TABLE `tb_barang`
ADD PRIMARY KEY (`id_barang`);
--
-- Indeks untuk tabel `tb_barang_masuk`
--
ALTER TABLE `tb_barang_masuk`
ADD PRIMARY KEY (`id_brg_msk`),
ADD KEY `id_supplier` (`id_supplier`);
--
-- Indeks untuk tabel `tb_det_brg_msk`
--
ALTER TABLE `tb_det_brg_msk`
ADD PRIMARY KEY (`id_det_brg_msk`),
ADD KEY `id_barang` (`id_barang`),
ADD KEY `id_brg_msk` (`id_brg_msk`);
--
-- Indeks untuk tabel `tb_pelanggan`
--
ALTER TABLE `tb_pelanggan`
ADD PRIMARY KEY (`id_pelanggan`);
--
-- Indeks untuk tabel `tb_supplier`
--
ALTER TABLE `tb_supplier`
ADD PRIMARY KEY (`id_supplier`);
--
-- Indeks untuk tabel `tb_user`
--
ALTER TABLE `tb_user`
ADD PRIMARY KEY (`id_user`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `tb_det_brg_msk`
--
ALTER TABLE `tb_det_brg_msk`
MODIFY `id_det_brg_msk` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT untuk tabel `tb_user`
--
ALTER TABLE `tb_user`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 */;