0% found this document useful (0 votes)
37 views5 pages

Select Nama, Sum (Stok) As Jumlah - Stok From Barang Where Nama Like '%led%' GROUP by Nama Having Sum (Stok)

The document contains 15 SQL queries that are selecting, grouping, filtering, and aggregating data from various database tables related to sales, inventory, transactions, and accounting. The queries are retrieving fields like names, counts, sums, averages, and other attributes to analyze stock levels, sales amounts, transaction volumes, and more.

Uploaded by

Mawar Puspadiana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

Select Nama, Sum (Stok) As Jumlah - Stok From Barang Where Nama Like '%led%' GROUP by Nama Having Sum (Stok)

The document contains 15 SQL queries that are selecting, grouping, filtering, and aggregating data from various database tables related to sales, inventory, transactions, and accounting. The queries are retrieving fields like names, counts, sums, averages, and other attributes to analyze stock levels, sales amounts, transaction volumes, and more.

Uploaded by

Mawar Puspadiana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

select nama,sum(stok) as jumlah_stok from barang where nama like '%led%' GROUP by nama having
sum(stok)

2. select tgl_trans,avg(jml_trans) from transaksi

3. select tgl_trans,sum(jml_trans)as total_transaksi from transaksi group by tgl_trans


4. select nama,(pegawai.id_pegawai),count(id_nota) as jumlah_nota_ditangani from pegawai join
nota_penjualan on pegawai.id_pegawai=nota_penjualan.id_pegawai group by (id_pegawai)

5. select max(harga) as maksimum_harga,min(harga) as minimum_harga from barang

6. select concat(id_pegawai,' ',alamat)as identitas_pelanggan from pegawai where id_pegawai like '%2'
7. select RPAD(nama,'8','***') as nama_pelanggan from pelanggan

8. select replace (nama,'o','i'),id_pelanggan from pelanggan where id_pelanggan='8911223344'

9. select tgl_jual,total_jual,kode_outlet from penjualan where discount >7 or total_bayar< 50000 group
by tgl_jual
10. select replace(kode_kue,'C','O') as kode,no_nota from detail_jual where jumlah>5 group by
kode_kue

11. select sum(harga_satuan)as harga_satuan,kode_jenis_kue from kue where kode_jenis_kue='KUKE'


and harga_satuan<30000

12. select total_jual from penjualan where kode_outlet='ABR' and tgl_jual=20130101


13. select kode_akun,nama_akun from akun where kode_akun%2<>0 and nama_akun like 'u%'

14. select avg(nominal)as rata_rata from jurnal_penjualan where posisi_dr_cr='kredit'

15. select avg(total_jual)as rata_rata from penjualan where total_jual>35000

You might also like