Tugas Basis Data (Key)

Nama : Dwi Indra Oktoviandy
NIM : A11.2012.07105
Klpk : A11.4405



1.       Carilah KF-2 Tabel Tersebut!
2.       Carilah Superkey, Candidate Key, dan Primary Key!



Jawab :
Berdasarkan Ketergantungan Fungsionalnya : 
Kode_brg -> nama_brg, hrg_sat

Nm_kons -> almt_kons, kota_kons 

No_fak -> nm_kons, tgl_faktur 

No_faktur, kode_brg -> jml, bayar 


Maka Tabel tersebut dapat didekomposisi menjadi 4 Tabel :
 

Faktur

Tabel Faktur (A, B, C)           = A -> BC


 A -> BC
 A -> A
 A -> ABC (Union)
 Super Key          = A
 Candidate Key  = A
 Primary Key       = A
 Foreign Key       = C


Konsumen


Tabel Konsumen (C, D, E) = C -> DE
      C -> DE
      C -> C
      C -> CDE (Union)
      Super Key        = C
      Candidate Key  = C
      Primary Key     = C
Foreign Key      = - 

Order
Tabel Order (A, F, H, J)    = AF -> HJ
      AF -> HJ
      AF -> AF
      AF -> AFHJ (Union)
      Super Key        = AF
      Candidate Key  = -
      Primary Key     = -
Foreign Key      = A dan F
  
Barang
Tabel Barang (F, G, I)      = F -> GI
      F -> GI
      F -> F
      F -> FGI (Union)
Super Key        = F
      Candidate Key  = F
      Primary Key     = F
Foreign Key      = -


A -> BC
C -> DE
A -> BCDE (Union)
A -> A (Reflexive)
A -> ABCDE (Union)

F -> GI
F -> F (Reflexive)
F -> FGI (Union)

AF -> HJ
Karena A -> ABCDE
AF -> ABCDEHJ
Karena F -> GI
AF -> ABCDEGHIJ
AF -> R (Super Key)
Jadi
Super Key               = AF
Candidate Key        = -
Primary Key           = -


0 comments:

Post a Comment