Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create database apotek;
- use apotek;
- create table barang(
- id_barang int not null primary key auto_increment,
- kode_barang varchar(20) not null,
- nama_barang varchar(50) not null,
- harga_barang int,
- stok_barang int,
- gambar_barang text,
- unique(kode_barang),
- is_active tinyint default 1
- );
- create table transaksi(
- id_transaksi int not null primary key auto_increment,
- no_transaksi varchar(50),
- tanggal_transaksi datetime,
- nomor int DEFAULT 0
- );
- create table item_transaksi(
- id_item_transaksi int not null primary key auto_increment,
- harga_item_transaksi int,
- qty_item_transaksi int,
- total_item_transaksi int,
- id_barang int,
- id_transaksi int,
- foreign key(id_transaksi) references transaksi(id_transaksi),
- foreign key(id_barang) references barang(id_barang)
- );
- create table users(
- id_user int not null primary key auto_increment,
- nama_user varchar(100),
- email_user varchar(100),
- password_user varchar(200),
- role_user enum("admin","kasir"),
- first_login TINYINT default 1,
- is_active TINYINT DEFAULT 1
- );
- insert into users value (null,"Admin","admin@mail.com","$2y$10$065KApwfqfNTQ32ktF.PoOJFnEfMpMZkPMQlR2Nw8I7BLqDYC4saO","admin");
Add Comment
Please, Sign In to add comment