eyoku_

Untitled

Jun 16th, 2020
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. create database apotek;
  2. use apotek;
  3.  
  4. create table barang(
  5. id_barang int not null primary key auto_increment,
  6. kode_barang varchar(20) not null,
  7. nama_barang varchar(50) not null,
  8. harga_barang int,
  9. stok_barang int,
  10. gambar_barang text,
  11. unique(kode_barang),
  12. is_active tinyint default 1
  13. );
  14.  
  15. create table transaksi(
  16. id_transaksi int not null primary key auto_increment,
  17. no_transaksi varchar(50),
  18. tanggal_transaksi datetime,
  19. nomor int DEFAULT 0
  20. );
  21.  
  22. create table item_transaksi(
  23. id_item_transaksi int not null primary key auto_increment,
  24. harga_item_transaksi int,
  25. qty_item_transaksi int,
  26. total_item_transaksi int,
  27. id_barang int,
  28. id_transaksi int,
  29. foreign key(id_transaksi) references transaksi(id_transaksi),
  30. foreign key(id_barang) references barang(id_barang)
  31. );
  32.  
  33.  
  34.  
  35. create table users(
  36. id_user int not null primary key auto_increment,
  37. nama_user varchar(100),
  38. email_user varchar(100),
  39. password_user varchar(200),
  40. role_user enum("admin","kasir"),
  41. first_login TINYINT default 1,
  42. is_active TINYINT DEFAULT 1
  43. );
  44.  
  45. insert into users value (null,"Admin","admin@mail.com","$2y$10$065KApwfqfNTQ32ktF.PoOJFnEfMpMZkPMQlR2Nw8I7BLqDYC4saO","admin");
Add Comment
Please, Sign In to add comment