create trigger tr_status
on nilai
for insert, update
as
declare @nim char (5)
declare @nilai float
select @nim=nim, @nilai=nilai from nilai
if @nilai >= 60
update keterengan set ket ='lulus' where nim=@nim
else update keterangan set ket='tidak lulus' where nim=@nim
===macam-macam perintah select===
select * from toko_buku
select kode_buku, harga from toko_buku
select kode_buku,harga * 0.3 from toko_buku
select max(harga) from toko_buku
select min(harga) from toko_buku
select count(harga) from toko_buku
select kode_buku, nama_buku from toko_buku order by penerbit
select * from toko_buku where kode_buku='B001' and harga<=45000;
select distinct nama_buku from toko_buku
select count(*) from toko_buku where kode_buku='B001' and harga<=45000;
Tidak ada komentar:
Posting Komentar