Professional Documents
Culture Documents
/**
* get amount of family that have a house with good condition by region, group b
y year
*/
SELECT count(a.id_rt) as jumlah, a.tahun FROM tbl_rt a join tbl_perumahan_survey
b on a.id_rt=b.id_rt where b.kondisi_atap_rumah='Baik' and kondisi_dinding_ruma
h='Baik' and kondisi_lantai_rumah='Baik' and a.id_desa_kelurahan in (1,2) group
by a.tahun
/**
* get amount of familiy that have a bad sanitation by region, group by year
*/
SELECT count(a.id_rt) as jumlah, a.tahun FROM tbl_rt a join tbl_sanitasi_peneran
gan_survey b on a.id_rt=b.id_rt where b. kepemilikan_jamban ='Tidak Memiliki' a
nd a.id_desa_kelurahan in (1,2) group by a.tahun
/**
* get amount of people that not go to school by region, group by year
*/
SELECT b.jumlah, a.tahun FROM tbl_rt a join (select count(x.id_art) as jumlah, x
.id_rt from tbl_art x join tbl_art_perorangan y on x.id_art=y.id_art where y.par
tisipasi_sekolah='Ya') b on a.id_rt=b.id_rt where a.id_desa_kelurahan in (1,2)
group by a.tahun
/**
* TIK
*/
SELECT count(a.id_rt) as jumlah, a.tahun FROM tbl_rt a join tbl_tik b on a.id_rt
=b.id_rt where b.telepon ='Ya' or b.handphone='Ya' and a.id_desa_kelurahan in (1
,2) group by a.tahun
SELECT count(a.id_rt) as jumlah, a.tahun FROM tbl_rt a join tbl_tik b on a.id_rt
=b.id_rt where b.komputer ='Ya' and a.id_desa_kelurahan in (1,2) group by a.tah
un
SELECT count(a.id_rt) as jumlah, a.tahun FROM tbl_rt a join tbl_tik b on a.id_rt
=b.id_rt where b.internet ='Ya' and a.id_desa_kelurahan in (1,2) group by a.tah
un