database - Data Logical organization -
i have 2 tables: counterparties , customers. , both have address field. don't know, better if create third table "addresses"?
the first way:
counterparty
- id
- name
- city
- streetname
- room
customer
- id
- firstname
- lastname
- city
- streetname
- room
second way:
counterparty
- id
- name
- addressid
customer
- id
- firstname
- lastname
- addressid
address
- id
- city
- streetname
- room
what better way?
the first solution better, unless either:
- you have customers counterparties (but should change whole schema design), or
- several customers and/or counterparties have same address (for instance in same building).
there no other reasons choose second solution.
Comments
Post a Comment