Sei sulla pagina 1di 6

Nota Pembayaran Sebelum Di Normalisasi No_Nota Tgl_Order Tgl_Selesai 5-Jan-12 9-Jan-12 N101 5-Jan-12 9-Jan-12 N101 Kasir Reny

Reny Customers Made Made Alamat Denpasar Denpasar . . .

. Nama_Brg Nama_Bhn Qty . Pintu Pagar . Pintu Dorong Baja Besi 5 2

Harga Rp 120,000 Rp 100,000

Jumlah Rp 600,000 Rp 200,000

Upah Rp 1,500,000 Rp 1,000,000

Uang_Muka . Rp 500,000 Rp 200,000 . .

. Jth_Tempo . . 12-Jan-12 12-Jan-12

Total Rp 1,600,000 Rp 1,000,000

Normalisasi Tahap I : No_Nota Tgl_Jual, Tgl_Order, Tgl_Selesai, Kasir, Customers, Alamat, Nama_Brg, Nama_Bhn, Qty,Jth_Tempo, Total. Total Harga, Jumlah, Upah, Uang_Muka.

Normalisasi Tahap II : ID_Cust ID_Kas ID_Brg ID.Bhn Customers, Alamat. Kasir. Nama_Brg, Upah. Nama Bhn, Harga. No_Nota, ID_Cust Tgl_Jual, Tgl_Order, Tgl_Selesai, Uang_Muka, Jth_Tempo, Total. No_Nota, ID_Brg Qty, Jumlah.

Nota Pembayaran Sesudah Di Normalisasi

1. Tabel Customers ID_Cust Customers Alamat C001 Gede Denpasar C002 Made Gianyar C003 Nyoman Denpasar C004 Ketut Badung Coding SQL Create database Bengkel Create Table tb_Customers ( ID_Cust Customers Alamat Telepon ); Char(4) Primary Key Not Null, Varchar(20), Varchar(30), Varchar(10), Telepon 987662 726762 769752 989882

2. Tabel Kasir ID_Kas K001 K002 K003 K004 Kasir Reny Karang Anop Melati Alamat Kuta Denpasar Sesetan Ubung Telepon 767865 793987 928832 229383

Coding SQL Create Table tb_Kasir ( ID_Kas Kasir Alamat Telepon ); 3. Tabel Bahan ID_Bhn B001 B002 B003 B004 Nama_Bhn Baja Besi Tembaga Nikel Harga 120000 100000 70000 80000 Stok 1000 pcs 700 pcs 200 pcs 500 pcs Char(4) Primary Key Not Null, Varchar(20), Varchar(30), Varchar(10),

Coding SQL Create Table tb_Bahan ( ID_Bhn Nama_Bhn Harga Stok ); Char(4) Primary Key Not Null, Varchar (15), Numeric, Varchar (6)

4. Tabel Barang ID_Brg BR001 BR002 Nama_Brg Pintu Pagar Pintu Dorong Upah Uang_Muka 1500000 500000 1000000 200000

Coding SQL Create Table tb_Barang ( ID_Brg Nama_Brg ); 5. Tabel Pemasok ID_Pms Nama_Pemasok PM001 Asep PM002 Saipul PM003 Tom PM004 Jacky Coding SQL Create Table tb_Pemasok ( ID.Pms Char(5) Primary Key Not Null, Alamat Denpasar Denpasar Denpasar Denpasar Telepon 237276 343878 234834 343439 ID_Bhn B001 B002 B003 B004 Harga 100000 80000 50000 60000 Char(4) Primary Not Null, Varchar(15),

Nama_Pemasok Varchar(20), Alamat Varchar(30), Telepon Varchar(10),

ID_Bhn Char(4) foreign key references Bahan (ID_Bhn) on update cascade on delete cascade, );

6. Tabel Pembayaran ID_Byr ID_Cust ID_Kasir ID_Brg ID_Bhn Tgl_Order Tgl_Selesai N100 C001 K001 BR001 B001 2-Jan-12 7-Jan-12 N101 C002 K002 BR001 B001 5-Jan-12 9-Jan-12 N099 C003 K002 BR002 B002 1-Jan-12 8-Jan-12 N102 C004 K001 BR001 B002 5-Jan-12 7-Jan-12 Coding SQL Create Table tb_Pembayaran ( ID_Byr Char(4),Primary Key Not Null,

ID_Cust Char(4) foreign key references Customers(ID_Cust) on update cascade on delete cascade, ID_Kas Char(4) foreign key references Customers(ID_Kas) on update cascade on delete cascade, ID_Brg Char(5) foreign key references Barang(Barang) on update cascade on delete cascade, ID_Bhn Char(4) foreign key references Bahan(ID_Bhn) on update cascade on delete cascade, Tgl_Order Tgl_Selesai ); Datetime, Datetime,

Customers

Customers Alamat Telepon