Senin, 20 Maret 2017

TUGAS 3 PSQLB







TUGAS 3 PSQLB
Nama : Andrianus WW
NIM  : 201553079
Kelas : B



11. Edit table barang, tambahkan 1 field tanggal kadaluarsa
ALTER TABLE barang ADD kadaluarsa date



12. Isi tanggal kadaluarsa
update barang set kadaluarsa = '02/11/2016' where jnsbrg = 'mie instan'
update barang set kadaluarsa = '11/11/2017' where jnsbrg = 'shampoo'
update barang set kadaluarsa = '09/10/2017' where jnsbrg = 'pasta gigi'
update barang set kadaluarsa = '02/09/2017' where jnsbrg = 'Rokok'
update barang set kadaluarsa = '02/05/2017' where jnsbrg = 'Susu Bayi'




13. Tampilkan tanggal kadaluarsa
select kadaluarsa from barang
 


14. Hapus tanggal kadaluarsatahun 2016
Delete from barang where kadaluarsa like '%2016%'

 


15. Ubah tanggal kadaluarsa yang bulan mei menjadai bulan agustus
update barang set kadaluarsa = '08/08/2017' where kadaluarsa = '11/11/2017'

 


16. Edit table supplier, tambahkan 1 field jenis produk
ALTER TABLE supplier add jenis_produk varchar(20)
 


17. Isi jenis produk
update supplier set jenis_produk = 'Sabun' where kdsup = '001'
update supplier set jenis_produk = 'Sabun Cuci' where kdsup = '002'
update supplier set jenis_produk = 'Mie Instan' where kdsup = '003'
update supplier set jenis_produk = 'Sabun Mandi' where kdsup = '004'
update supplier set jenis_produk = 'Pasta Gigi' where kdsup = '005'
update supplier set jenis_produk = 'Rokok' where kdsup = '006'
update supplier set jenis_produk = 'Susu Bayi' where kdsup = '007'
update supplier set jenis_produk = 'Shampoo' where kdsup = '008'
update supplier set jenis_produk = 'Shampoo Bayi' where kdsup = '009'
update supplier set jenis_produk = 'Biore' where kdsup = '010'
 


18. Tampilkan semua jenis produk
select jenis_produk from supplier
 


19. Hapus untuk jenis produk mie instan
Delete from supplier where jenis_produk like '%mie instan%'
 


20. Ubah jenis produk,sabun mandi menjadi sabun cuci
update supplier set jenis_produk = 'Sabun Cuci' where jenis_produk = 'Sabun Mandi'
 


PRAKTEK SQL SERVER MEMBUAT RETUR JUAL

Hello kawan, kembali lagi dengan saya, andre, pada kesempatan kali ini kita mau belajar membuat retur jual, kita perlu membuat table nya t...