Silahkan klik ini untuk mendownload materi yang dilengkapi gambar tampilan atau klik ini.
Studi Kasus : Database Penginapan Hotel

1.      MENDESKRIPSIKAN TABEL (DDL)
Ø  Membuat Database Penginapan
SQL:
Create database penginapan;
Show databases;
Use penginapan;
Ø  Membuat Tabel Tamu
SQL:
Create table tamu(idtamu char(5) not null primary key,
Nama char(50) not null,
Alamat char(100) not null,
Usia char(2) not null,
Noktp char(2) not null);
Desc tamu;
Ø    Membuat tabel kamar

SQL:
Create table kamar(kdkamar char(5) not null primary key,
Jenis char(20) not null,
Tipe_kamar char(20) not null,
Tarif int);
Desc kamar;

Ø  Membuat tabel sewa
SQL:
Create table sewa(idtamu char(5) not null,
Kdkamar char(5) not null,
Lama_sewa int not null);
Desc sewa; e:AR-� � D s РW x�W /b> kamar;


2.      MENGISI TABEL (DML)
Ø  Mengisi tabel tamu
SQL:
Insert into tamu(idtamu, nama, alamat, usia, noktp)
Values(‘00848’,’Ihsan Fauzi Rahman’.’Cihampelas, Bandung Barat’,’20’,’13’);
Select * from tamu;

Ø  Mengisi tabel Kamar
SQL:
Insert into kamar(kdkamar, jenis, tipe_kamar, tarif)
Values(‘bm003’,’Bulan Madu’,’Executive Class’,’5000000’);
Select * from kamar;



Ø  Mengisi tabel Sewa
SQL:
Insert into sewa(idtamu, kdkamar, lama_sewa)
Values(‘00848’, ‘bm003’, ‘3’);
Select * from sewa;


3.      SINTAK MENAMPILKAN TABLE (Nama, Jenis, Lama_sewa, Bayar) (SQL)
SQL:
Select nama, jenis, lama_sewa, (lama_sewa*tarif) as bayar from tamu, kamar, sewa;Select * from sewa;

2 comments:

  1. Heya are using Wordpress for your site platform? I'm new to the blog world but I'm trying to get started and set up my own.
    Do you require any coding knowledge to make your own blog?
    Any help would be really appreciated!
    Feel free to surf my homepage ... european football transfer news

    BalasHapus
  2. I love your blog.. very nice colors & theme. Did you make
    this website yourself or did you hire someone to do it for you?
    Plz reply as I'm looking to construct my own blog and would like to know where u got this from. thanks a lot
    My site :: colonias

    BalasHapus

Silahkan Komentar, Kritik atau Saran.

 
Top