Praktek SQL 2

create table supplier

(kdsup varchar (10) primary key,

nmsup varchar (50),

tgllhr date,

alamatkantor varchar (50),

telpkantor varchar (15),

jekel varchar (15),

email varchar (20))

select*from supplier

insert into supplier values('sup001','Firman Ilahudin','1980/04/12','Jl. Gondang Manis','0291-5546738','Pria','Firman001@gmail.com')

insert into supplier values('sup002','Joko Waluyo','1979/03/07','Jl.Bumi Winosari','024-889772','Pria','Jwal@gmail.com')

insert into supplier values('sup003','Ilham Wahid','1982/08/19','Jl. Dersalam','0291-889324','Pria','Wahid@gmail.com')

insert into supplier values('sup004','Farid Yuliyanto','1997/07/18','Jl. Krandon','0291-657457','Pria','Farid@gmail.com')

insert into supplier values('sup005','Saiful Bayudha','1994/09/12','Jl. Wergu','024-789326','Pria','Saiful@gmail.com')

insert into supplier values('sup006','Kamal al fitra','1995/08/06','Jl. Janggalan','029-568987','Pria','Kamal@gmail.com')

insert into supplier values('sup007','Arief yufrizal','1997/04/29','Jl. Gondang Manis','024-548321','Pria','Arief@gmail.com')

insert into supplier values('sup008','Lina Noviana','1997/05/10','Jl. Jepara','0291-749082','Wanita','Lina@gmail.com')

insert into supplier values('sup009','Diana Sekar','1997/03/18','Jl. Mayong','0291-645096','Wanita','Sekar@gmail.com')

insert into supplier values('sup010','Fiyya Laila','1998/09/27','Jl. Ahmad Yani','0291-749026','Wanita','Fiyya@gmail.com')

1. tampilkan data supplier yang kantornya daerah Dersalam

select*from supplier where alamatkantor like'%dersalam%'


2. tampilkan data email supplier yang rumahnya daerah gondang manis

select email from supplier where alamatkantor like'%gondang%'


3. tampilkan data supplier yang rumahnya daerah krandon

select*from supplier where alamatkantor like'%krandon%'


4. tampilkan data supplier yang lahir tahun 1997

select*from supplier where tgllhr like'%1997%'


5. tampilkan data supplier yang namanya arief

select*from supplier where nmsup like'%arief%'


6. tampilkan data supplier yang daerah wergu

select*from supplier where alamatkantor like'%wergu%'


7. tampilkan data supplier yang lahir tahun 1997 dan daerah krandon

select*from supplier where tgllhr like'%1997%' and alamatkantor like'%krandon%'


8. tampilkan data supplier yang namanya fiyya dan kamal

select*from supplier where nmsup like'%fiyya%' or nmsup like'%kamal%'



9. tampilkan no telpon supplier farid

select telpkantor from supplier where nmsup like'%farid%'


10. tampilkan alamat kantor supplier saiful

select alamatkantor from supplier where nmsup like'%saiful%'


Komentar