contoh sensus penduduk
desain database menggunakan sql server 2008
contoh program
sederhana
desain database
sensus penduduk
menggunakan
sql
server 2008
ni adalah contoh sederhana desain database sql server
2008
"semoga bermanfaat "
create database pensensusanmasyrakatdalamkelurahan
use pensensusanmasyrakatdalamkelurahan
create table penduduk(
noktp int primary key,
nama char (20),
alamat char(20),
pekerjaan char(25),
norumah int,
agama char(10),
jeniskelamin char(1))
insert into pendudukvalues('111087','sugianto','jl.kotacane','wiraswasta','22','katolik','p')
insert into pendudukvalues('632874','carles','jl.kotacane','polisi','15','islam','p')
insert into pendudukvalues('758237','monita','jl.kotacane','guru','22','katolik','l')
insert into pendudukvalues('683628','latersia','jl.kotacane','wiraswasta','22','katolik','l')
select*from penduduk
create table pindahan(
nopindahan int primary key,
noktp int foreign key references penduduk (noktp),
nama char(50),
alamat char(20),
pekerjaan char(25),
norumah int,
agama char(10),
jeniskelamin char(1),
asalpindahan char(30))
drop table pindahan
insert into pindahanvalues('008','111087','sugianto','jl.kotacane','wiraswasta','22','katolik','p','samosir')
insert into pindahanvalues('032','632874','anjra','jl.medan','polisi','22','islam','l','samosir')
insert into pindahanvalues('055','758237','indra','jl.bandung','pengaguran','22','budha','l','padang')
insert into pindahanvalues('065','683628','utri','jl.jakarta','septa','22','islam','p','jawa')
select*from pindahan
create table kematian(
noktp int primary key,
nama char(20),
alamat char(20),
pekerjaan char(25),
norumah int,
agama char(10),
jeniskelamin char(1),
tglkematian datetime)
insert into kematianvalues('393239','jufri','jl.kotacane','wiraswasta',423,'islam','l',09/09/1997 )
insert into kematianvalues('328732','halimah','jl.kotacane','wiraswasta',67,'islam','p',12/10/1985 )
insert into kematianvalues('111087','joko','jl.kotacane','wiraswasta',687,'islam','p',15/05/1987 )
insert into kematianvalues('111597','hona','jl.kotacane','wiraswasta',646,'islam','l',08/10/1997 )
select*from kematian
|
create table fropil(
noktp int primary key,
nama char(20),
alamat char(20),
pekerjaan char(25),
norumah int,
agama char(20),
jeniskelamin char(1),
fropil char(25))
insert into fropil values('576227','gino','jl.kota cane','bertani','567','kristen protestan','l','duda')
insert into fropil values('638597','guni','jl.kota cane','bertani','75','kristen protestan','l','berkeluarga')
insert into fropil values('789767','siah','jl.kota cane','wiraswasta','566','islam','l','janda')
insert into fropil values('575068','napa','jl.kota cane','tentara','567','katolik','l','berkeluarga')
select*from fropil
create table keterangan(
noktp int foreign key references kematian (noktp),
nama char(20),
jumlahanak int)
select * from keterangan
drop table keterangan
insert into keterangan values('393239','sugeng','8')
insert into keterangan values('328732','hardino','7')
insert into keterangan values('111087','nandangi','2')
insert into keterangan values('111597','iko','3')
select*from keterangan
Comments
Post a Comment