Monday, March 20, 2017

PRAKTEK PEMOGRAMAN SQL 3

Tugas Praktek Pemograman SQL Tanggal 21 Maret 2017 

11. Edit table barang,tambahkan 1 field tanggal kadarluwarsa
ALTER TABLE Barang ADD kadarluarsa date


12. Isi tanggal kadarluarsa
update barang set kadarluarsa='2016/03/20' where kdbrg=001
update barang set kadarluarsa='2017/05/25' where kdbrg=002
update barang set kadarluarsa='2017/10/22' where kdbrg=003
update barang set kadarluarsa='2017/01/06' where kdbrg=004
update barang set kadarluarsa='2017/12/29' where kdbrg=005

13.Tampilkan tanggal kadarluarsa
select kadarluarsa from Barang
14. Hapus tanggal kadarluarsa yang tahun 2016
delete from barang where kadarluarsa like '%2016%'

15. Rubah tanggal kadarluarsa bulan mei,menjadi bulan agustus
update barang set kadarluarsa='2017/08/25' where kdbrg=002
16. Edit,tabel supplier,tambahkan 1 field jenis produk
ALTER TABLE Supplier ADD jenisproduk varchar(20)
17. Isi jenis produk
update supplier set jenisproduk='mie instan' where kdsup='Sup001'
update supplier set jenisproduk='shampo' where kdsup='Sup002'
update supplier set jenisproduk='pasta gigi' where kdsup='Sup003'
update supplier set jenisproduk='rokok' where kdsup='Sup004'
update supplier set jenisproduk='susu bayi' where kdsup='Sup005'
update supplier set jenisproduk='kosmetik' where kdsup='Sup006'
update supplier set jenisproduk='sabun mandi' where kdsup='Sup007'
update supplier set jenisproduk='pelembut pakaian' where kdsup='Sup008'
update supplier set jenisproduk='snack' where kdsup='Sup009'
update supplier set jenisproduk='sabun muka' where kdsup='Sup010'
18. Tampilkan semua jenis produk
select jenisproduk from supplier 

19. Hapus untuk jenis produk mie instan
delete from supplier where jenisproduk like '%mie instan%


20. Rubah jenis produk,dari sabun mandi menjadi sabun cuci 
update supplier set jenisproduk='sabun cuci' where kdsup='Sup006'



No comments:

Post a Comment