//----Address 1 - State - Provinsi
select 
	mp.idprovinsi as id_idprovinsi, mp.namaprovinsi as nm_namaprovinsi 
from m_provinsi mp;

//----Address 2 - City - Kota
select 
	mk.idkota as id_idkota, mk.namakota as nm_namakota, 
	mp.idprovinsi as ref_idprovinsi , mp.namaprovinsi as ref_namaprovinsi 
from m_kota mk 
join m_provinsi mp on mp.idprovinsi = mk.idprovinsi;

//----Address 3 - Distric - Kecamatan
select 
	mc.idkecamatan as id_idkecamatan, mc.namakecamatan as nm_namakecamatan,
	mk.idkota as ref_idkota, mk.namakota as ref_namakota
from m_kecamatan mc
join m_kota mk on mk.idkota = mc.idkota;

//----Address 4 - Village - Kelurahan
select 
	ml.idkelurahan as id_idkelurahan, ml.namakelurahan as nm_namakelurahan,
	mc.idkecamatan as id_idkecamatan, mc.namakecamatan as nm_namakecamatan
from m_kelurahan ml
join m_kecamatan mc on mc.idkecamatan = ml.idkecamatan;
