Kamis, 23 Maret 2017

Tugas 3 Pemrograman SQL

Assalamualaikum Wr. Wb
Lanjutan dari Tugas Pemrograman SQL

use "201553028"

11.   Edit table barang, tambahkan 1 field tanggal kadaluarsa
alter table barang add kadaluarsa date



12. Isi tanggal kadaluarsa

update barang set kadaluarsa='10/10/2010' where kdbrg='001'
update barang set kadaluarsa='11/11/2011' where kdbrg='002'
update barang set kadaluarsa='12/12/2012' where kdbrg='003'
update barang set kadaluarsa='05/05/2013' where kdbrg='004'
update barang set kadaluarsa='06/06/2016' where kdbrg='005'

13. Tampilkan Tanggal Kadaluarsa 

         select * from barang

14. Rubah tanggal kadaluarsa yang tahun 2016 menjadi tanggal 2017

update barang set kadaluarsa='12/10/2017' where kdbrg='005'


15. Rubah tanggal kadaluwarsa yang bulan Mei, menjadi bulan Agustus

update barang set kadaluarsa='08/05/2013' where kdbrg='004'
 

 
16. Edit table supplier tambahkan 1 field jenis produk

alter table Supplier add jenisproduk varchar(25)
select * from supplier
 
 


17. Isi jenis produk

update Supplier set jenisproduk='rokok' where kdsup='sup001'
update Supplier set jenisproduk='rokok' where kdsup='sup002'
update Supplier set jenisproduk='rokok' where kdsup='sup003'
update Supplier set jenisproduk='pewangi pakaian' where kdsup='sup004'
update Supplier set jenisproduk='pasta gigi' where kdsup='sup005'
update Supplier set jenisproduk='sabun mandi' where kdsup='sup006'
update Supplier set jenisproduk='mie instan' where kdsup='sup007'
update Supplier set jenisproduk='pasta gigi' where kdsup='sup008'
update Supplier set jenisproduk='susu bayi' where kdsup='sup009'
update Supplier set jenisproduk='rokok' where kdsup='sup010'

18. Tampilkan semua jenis produk

select * from Supplier





19. Hapus untuk jenis produk mie instan

delete from Supplier where jenisproduk='mie instan'


20.Rubah jenis produk, dari sabun mandi menjadi sabun cuci 

update Supplier set jenisproduk='sabun cuci' where kdsup='sup006'
 
 

Alhamdulillah 😊 Semoga Bermanfaat Kawan 😊
Waalaikumussalam Wr. Wb





Tidak ada komentar:

Posting Komentar