Anda di halaman 1dari 1

1.)(a.

)CREATE DATABASE KURSUS


use KURSUS

create table PELATIHAN(KODE varchar(9),TGL_DAFTAR date)

(b.)insert into PELATIHAN


values(‘WR/PKA/02’,’02/15/2020’)

insert into PELATIHAN


values(‘AC/PKA/03’,’03/05/2020’)

insert into PELATIHAN


values(‘EX/PKB/02’,’02/10/2020’)

insert into PELATIHAN


values(‘PW/PKC/01’,’03/12/2020’)

insert into PELATIHAN


values(‘PW/PKB/01’,’03/10/2020’)

insert into PELATIHAN


values(‘WR/PKC/02’,’03/11/2020’)

insert into PELATIHAN


values(‘EX/PKB/02’,’03/12/2020’)

insert into PELATIHAN


values(‘AC/PKB/03’,’02/27/2020’)

2.)alter table PELATIHAN add KELAS_KURSUS varchar(20)


alter table PELATIHAN add LAMA integer
alter table PELATIHAN add HARGA_KURSUS integer
alter table PELATIHAN add TGL_MULAI date
alter table PELATIHAN add TOTAL_BAYAR integer
alter table PELATIHAN add TGL_SELESAI date

3.)update PELATIHAN set KELAS_KURSUS=’MS.WORD’ where substring(KODE,2,1)=’WR’


update PELATIHAN set KELAS_KURSUS=’MS.EXCEL’ where substring(KODE,2,1)=’EX’
update PELATIHAN set KELAS_KURSUS=’MS.POWERPOINT’ where substring(KODE,2,1=’PW’
update PELATIHAN set KELAS_KURSUS=’MS.ACCESS’ where substring(KODE,2,1=’AC’

update PELATIHAN set LAMA=01,02,03 where substring(KODE,9,1=’01,02,03’

Anda mungkin juga menyukai