guys mau tanya dunk, pake surrogate key yang bener kynya gmana sih? misal gw punya table customer, order, product dan line order. Nah untuk table line order ini sebetulnya pake composite PK (order_id & product_id) atau tetap nambahin column id sbg PK terus nambahin composite unique index u/ order_id & product_id
customer ( id , --> PK ... ) order ( id , --> PK customer_id , --> FK ... ) product ( id , --> PK ... ) ## nah, dibawah ini yang bener yang mana ya? ## line_item ( order_id bigint , --> PK, FK product_id bigint , --> PK, FK ... ) ## atau line_item ( id , --> PK order_id bigint , --> FK; composite unique index dg product_id product_id bigint , --> FK; composite unique index dg order_id ... ) TIA.

