Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Kuliah 3 Praktek Bentuk-bentuk Normal N1,N2,N3 Cara Dekomposisi

Presentasi serupa


Presentasi berjudul: "Kuliah 3 Praktek Bentuk-bentuk Normal N1,N2,N3 Cara Dekomposisi"— Transcript presentasi:

1 Kuliah 3 Praktek Bentuk-bentuk Normal N1,N2,N3 Cara Dekomposisi
Primary Key & Foreign Key

2 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Penempatan Pegawai  not N2 Data Penggunaan Sukucadang  N1,N2,N3 Nomor Pegawai Unit Kerja Tanggal Lahir Awal Ahir Per1 Penjualan 1 jun 83 20 Jun 80 5 Ags 83 Per2 3 Jul 51 5 Ags 81 9 Dec 82 Per3 Akuntansi 8 Ags 60 3 Feb 79 17 Jul 82 Produksi 11 Mar 82 3 Feb 85 Nomor Proyek Nomor Alat Jumlah Pemakaian Pro1 X1 17 Pro2 G214 85 AL56 73 80 Data Pengiriman  N1,N2,N3 Nomor Pengiriman Truk Pengirim Nama Supir Alamat Pengiriman 1 V6 Joni Antapani 2 J22 Joko Merdeka 3 Ahmad Lodaya 4 N12 Turangga Dekomposisi Lihat hal sebelah Asumsi : Setiap pengiriman diberi no urut unik

3 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Penempatan Pegawai  not N2 Penempatan Pegawai  N1,N2,N3 Nomor Pegawai Unit Kerja Tanggal Lahir Awal Ahir Per1 Penjualan 1 jun 83 20 Jun 80 5 Ags 83 Per2 3 Jul 51 5 Ags 81 9 Dec 82 Per3 Akuntansi 8 Ags 60 3 Feb 79 17 Jul 82 Produksi 11 Mar 82 3 Feb 85 Nomor Pegawai Unit Kerja Awal Ahir Per1 Penjualan 20 Jun 80 5 Ags 83 Per2 5 Ags 81 9 Dec 82 Per3 Akuntansi 3 Feb 79 17 Jul 82 Produksi 11 Mar 82 3 Feb 85 Foreign Key Primary Key Penempatan Pegawai  N1,N2,N3 Nomor Pegawai Tanggal Lahir Per1 1 jun 83 Per2 3 Jul 51 Per3 8 Ags 60 Primary Key

4 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Not N2 THEACHER SEMESTER SUBJECT SECTION ATTENDANCE Dosen Semester/Thn Mata Kuliah Jurusan Peserta Joe I/88 COBOL SECTION 1 35 Jenny MATH 40 Gregory 2/88 UNIX SECTION 2 33 42 47 50 SECTION 3 12

5 Dekomposisi Tabel Primary Key Foreign Key

6 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Data Proyek  Not N2 Data Penggunaan Alat  Not N2 Nomor Pegawai Nomor Proyek Anggaran Proyek Lama kerja pegawai di proyek P1 Proy1 20 P3 16 P2 Proy2 17 35 Proy3 84 42 83 P4 41 Nomor Proyek Manajer Proyek Nama Alat Jumlah Pemakaian P1 Joni PALU 7 P2 Heri 11 BOR 3 GERGAJI 20 Data Kerusakan  N1, N2, N3 Data Pegawai  not N2 Nomor Mesin Tanggal Rusak Nama Montir Lama Perbaikan E70 1 jun 81 Joni 12 E12 7 jul 81 Joko 6 7 Ags 81 20 jul 81 15 7 Nama Pegawai Alamat Pegawai Tanggal Pindah Kerja Joni Paskal 1 Jun 79 Heri Antapani 11 Ags 73 22 Sep 80 Emma Dago 27 Mar 77

7 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel N1, N2, N3 Nomor Pegawai Nomor Proyek Lama kerja pegawai di proyek P1 Proy1 20 P3 16 P2 Proy2 35 Proy3 42 17 83 P4 41 Data Proyek  Not N2 Nomor Pegawai Nomor Proyek Anggaran Proyek Lama kerja pegawai di proyek P1 Proy1 20 P3 16 P2 Proy2 17 35 Proy3 84 42 83 P4 41 Foreign Key N1,N2,N3 Nomor Proyek Anggaran Proyek Proy1 20 Proy2 17 Proy3 84 Primary Key

8 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Data Penggunaan Alat  Not N2 N1, N2, N3 Data Penggunaan Alat N1,N2,N3 Nomor Proyek Manajer Proyek Nama Alat Jumlah Pemakaian P1 Joni PALU 7 P2 Heri 11 BOR 3 GERGAJI 20 Nomor Proyek Manajer Proyek P1 Joni P2 Heri Nomor Proyek Nama Alat Jumlah Pemakaian P1 PALU 7 P2 11 BOR 3 GERGAJI 20 Foreign Key Primary Key Primary Key Data Pegawai  not N2 Nama Pegawai Alamat Pegawai Tanggal Pindah Kerja Joni Paskal 1 Jun 79 Heri Antapani 11 Ags 73 22 Sep 80 Emma Dago 27 Mar 77 Nama Pegawai Tanggal Pindah Kerja Joni 1 Jun 79 Heri 11 Ags 73 22 Sep 80 Emma 27 Mar 77 Nama Pegawai Alamat Pegawai Heri Antapani Joni Paskal Emma Dago Foreign Key Primary Key

9 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Data Proyek  Not N1, Not N2 Invoice Cust # Name Addr1 Addr2 Qty1 Part1 Amt1 Qty2 Part2 Amt2 1001 43 Jones 121 First Avenue 1 Motor 200 56 Nut 2.25 1002 55 Amy 15th Street LA 5 Saw 52 32 Brace 44.53 1003 22 Electric Blade Invoice Cust # Name Address Qty1 Part1 Amt1 Qty2 Part2 Amt2 1001 43 Jones First Avenue 121 1 Motor 200 56 Nut 2.25 1002 55 Amy LA 15th Street 5 Saw 52 32 Brace 44.53 1003 22 Electric Blade 121 Data Proyek  Not N1, Not N2

10 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Data Proyek  Not N1 (Repetitif) Not N2 Invoice Cust # Name Address Qty1 Part1 Amt1 Qty2 Part2 Amt2 1001 43 Jones First Avenue 121 1 Motor 200 56 Nut 2.25 1002 55 Amy LA 15th Street 5 Saw 52 32 Brace 44.53 1003 22 Electric Blade 121 Invoice Cust # Name Address Qty Part Amt 1001 43 Jones First Avenue 121 1 Motor 200 56 Nut 2.25 1002 55 Amy LA 15th Street 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Data Proyek  Not N2 (Redundan)

11 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Invoice Cust # Name Address Qty Part Amt 1001 43 Jones First Avenue 121 1 Motor 200 56 Nut 2.25 1002 55 Amy LA 15th Street 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Data Proyek  Not N2 (Redundan) Invoice Items  N1, N2, N3 Invoice Cust # Name Address 1001 43 Jones First Avenue 121 1002 55 Amy LA 15th Street 1003 Invoice Qty Part Amt 1001 1 Motor 200 56 Nut 2.25 1002 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Inv Cust  Not N2 (Redundan) Primary Key Foreign Key

12 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Invoice Cust # Name Address 1001 43 Jones First Avenue 121 1002 55 Amy LA 15th Street 1003 Invoice Qty Part Amt 1001 1 Motor 200 56 Nut 2.25 1002 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Invoice Items  N1, N2, N3 Inv Cust  Not N2 (Redundan) Primary Key Foreign Key Invoice Qty Part Amt 1001 1 Motor 200 56 Nut 2.25 1002 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Cust Inv N1, N2, N3 Cust Addr  N1, N2, N3 Invoice Cust # 1001 43 1002 55 1003 Cust # Name Address 43 Jones First Avenue 121 55 Amy LA 15th Street Invoice Items  N1, N2, N3

13 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Invoice Cust # Name Addr1 Addr2 Qty1 Part1 Amt1 Qty2 Part2 Amt2 1001 43 Jones 121 First Avenue 1 Motor 200 56 Nut 2.25 1002 55 Amy 15th Street LA 5 Saw 52 32 Brace 44.53 1003 22 Electric Blade Invoice Qty Part Amt 1001 1 Motor 200 56 Nut 2.25 1002 5 Saw 52 32 Brace 1003 22 Electric Blade 121 Cust Inv N1, N2, N3 Cust Addr  N1, N2, N3 Invoice Cust # 1001 43 1002 55 1003 Cust # Name Address 43 Jones First Avenue 121 55 Amy LA 15th Street Invoice Items  N1, N2, N3

14 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Pengambilan Barang Gudang  Sudah N1,N2,N3 NoGudang No Brg Proyek Jumlah Pngambilan Tanggal Not N2 Sudah N1,N2,N3 Poj1 dpt ambil brg PX7 lagi dari Gudang W1 pd hari lain Jadi tanpa tanggal tdk unik Pinjaman Koprasi Not N2

15 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Not N2 Sudah N1,N2,N3 Foreign Key Primary Key Primary Key

16 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Pinjaman Koprasi Not N2 Foreign Key Primary Key Primary Key

17 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Bila dalam satu konsultasi selalu melibatkan satu dokter dan satu pasien maka tabel diatas mempunyai 2 kunci (relation key), yaitu NoDokter dan Waktu Konsultasi atau NoPasien dan Waktu Konsultasi Sudah N1,N2,N3 (Tabel hanya mempunyai 1 Field Atribut Primary Key bebas pilih)

18 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Studi Kasus : Desainlah table-table untuk menyimpan data invoice disamping dengan catatan : Setiap Inv diberi Nomor Nomor di reset setiap awal tahun

19 Bentuk Normal & Dekomposisi Tabel
Kuliah 3 Bentuk Normal & Dekomposisi Tabel Tabel di atas belum normal : Tabel di atas masih mengandung data turunan Not N1 (masih Repetitif) : Tabel di atas dinamakan tidak memenuhi bentuk Normal ke 1 (N1), Bentuk Normal ke 1 Tabel tidak mengandung pengulangan kolom (Non Repetitif) karena hal ini berpotensi adanya data yg tidak tersimpan atau terjadi pemborosan kolom yg isinya kosong

20 Bentuk N1  Ubah repeating column shg menjadi sbb
Bentuk N2  Buang baris-baris redundan dengan memisah table gunakan link primary & foreign Key Belum N2 Primary Key Foreign Key Belum N3  Pisahkan table sesuai ketergantungan atribut pada keynya Inv Items Items Desc Invoice Customer

21 Tugas 2 : Praktek Dekomposisi Tabel
Kuliah 3 Tugas 2 : Praktek Dekomposisi Tabel Lakukan dekomposisi table-table sbb shg memenuhi bentuk N1,N2,N3 NIM Nama-MHS Alamat-MHS Tgl-Lahir Kode-Kuliah Nama-Kuliah SKS Smst Nilai Wkt-Kuliah Ruang-Kuliah Nama-Dosen Alamat-Dosen 9801 Ali Merdeka 10 Jak 40121 020179 IF110 Strukt Data 3 1 A Senin 08:00 Kamis 11:00 Ruang A Dr. Umar Garuda 1 Jak 43212 IF310 Basis Data 4 - Selasa 10:00 Jumat 08:00 Ruang B KU234 Bhs Ind 2 B Rabu 09:00 Dewi MA A Yani 14 Jak 40121 9802 Budi Gajahmada 2 Jak 45123 061078 MA115 Mtmtka 1 C Rabu 13:00 jumat 14:00 Ruang C Ir. Taufik Perum Dosen Wijaya Indah C5 Bogor 9804 Indah Sentosa 123 Bogor 43212 210679

22 Tugas 2 : Praktek Dekomposisi Tabel
Kuliah 3 Tugas 2 : Praktek Dekomposisi Tabel


Download ppt "Kuliah 3 Praktek Bentuk-bentuk Normal N1,N2,N3 Cara Dekomposisi"

Presentasi serupa


Iklan oleh Google