how to use

use hotelMaboy create table tamu( id_tamu integer not null primary key, nama varchar (50)not null, telp integer not null, alamat varchar (51) not null, no_ktp integer not null, );

create table fasilitas( idfasilitas integer not null primary key, namafasilitas varchar (14) not null, tarif_fasilitas integer not null, ); create table jenis_kamar( idjenis integer not null primary key, namafasilitas varchar (10) not null, tarifkamar integer not null, );

create table kamar( nomor integer not null primary key, idjenis integer not null references jenis_kamar (idjenis) on update cascade on delete no action, idfasilitas integer not null references fasilitas (idfasilitas) on update cascade on delete no action );

create table sewa_kamar( id_sewa integer not null primary key, id_tamu integer not null references tamu (id_tamu) on update cascade on delete no action, tgl_masuk datetime not null, tgl_keluar datetime not null );

create table status_kamar( status varchar (6) not null, id_sewa integer not null references sewa_kamar (id_sewa) on update cascade on delete no action, nomor integer not null references kamar (nomor) on update cascade on delete no action ); drop table status_kamar
INSERT INTO sewa_kamar (idfasilitas,id_sewa,id_tamu, tgl_masuk,tgl_keluar)
VALUES (1,1,123,’2008-04-19′, ‘2008-04-19 ‘)

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s