SHARE
TWEET

Untitled

a guest Oct 24th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Nomor 0*/
  2. select namabarang,stok,hargabeli from tblBarang order by namabarang ASC, hargabeli DESC;
  3. /*Nomor 1*/
  4. select namabarang,stok,hargabeli from tblBarang
  5. where (namabarang LIKE 'A%')OR(namabarang LIKE 'B%')OR(namabarang LIKE 'E%')OR(namabarang LIKE 'F%')
  6. OR(namabarang LIKE 'P%')
  7. order by namabarang ASC,hargabeli DESC;
  8. /*Nomor 2*/
  9. select namabarang,stok,hargabeli from tblBarang
  10. where namabarang not like '%Sti%'AND namabarang not like '%Nugget%'
  11. order by namabarang ASC,hargabeli DESC;
  12. /*Nomor 3*/
  13. select namabarang,stok from tblBarang
  14. where stok<1000
  15. order by namabarang DESC;
  16. /*Nomor 4*/
  17. select namabarang,stok from tblBarang
  18. where stok>=250 AND stok<=400
  19. order by stok ASC;
  20. /*Nomor 5*/
  21. select namabarang as 'NAMA BARANG',stok as 'JUMLAH STOK',hargabeli as 'HARGA BELI',stok*hargabeli as 'MODAL DASAR'
  22. from tblBarang
  23. order by stok*hargabeli ASC;
  24. /*Nomor 6*/
  25. select namabarang as 'NAMA BARANG',stok as 'JUMLAH STOK',hargabeli as 'HARGA BELI',stok*hargajual as 'HASIL PENJUALAN'
  26. from tblBarang
  27. where namabarang like '%Baso%' or namabarang like '%Nugget%' or namabarang like '%Sosis%'
  28. order by stok*hargajual DESC;
  29. /*nomor 7*/
  30. select namabarang as 'NAMA BARANG',stok as 'JUMLAH STOK',hargabeli as 'HARGA BELI',hargajual as 'HARGA JUAL',stok*hargajual as 'HASIL PENJUALAN',stok*hargabeli as 'MODAL DASAR',stok*hargajual-stok*hargabeli as 'LABA'
  31. from tblBarang
  32. order by stok*hargajual-stok*hargabeli DESC;
  33. /*Nomor 8*/
  34. select namabarang as 'NAMA BARANG',stok as 'JUMLAH STOK',hargabeli as 'HARGA BELI',hargajual as 'HARGA JUAL',stok*hargajual as 'HASIL PENJUALAN',stok*hargabeli as 'MODAL DASAR',stok*hargajual-stok*hargabeli as 'LABA'
  35. from tblBarang
  36. where namabarang not like '%Baso%'AND namabarang not like '%Sosis%' AND namabarang not like '%Nugget%'
  37. order by namabarang ASC;
  38. /*Nomor 9*/
  39. select namabarang as 'Nama Barang',stok as 'STOK',hargabeli as 'Harga Beli',hargajual as 'Harga Jual',hargajual-hargabeli as 'Selisih'
  40. from tblBarang
  41. where namabarang like '%Ayam%' OR namabarang like '%Chick%';
  42. /*Nomor 10*/
  43. select MAX(hargajual)as 'harga jual paling tinggi',MIN(hargajual) as 'harga jual paling rendah',MAX(hargabeli) as 'harga beli paling tinggi',
  44. MIN(hargabeli) as 'harga beli paling rendah', AVG(stok) as 'stok rata-rata'
  45. from tblBarang;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top