Storing multiple values for a single field in a database
15,635
Solution 1
You're supposed to create an ADDRESS
table that has a foreign key linking it to a PERSON
record, i.e. PERSON_ID
. This is the "relational" component of a relational database, and it's why it's more flexible than a flat file (which is like a single table).
Solution 2
Put adresses in a second table, give each adress a "Person ID", so that mutiple rows in the adress-table can referr to on person.
Author by
Some Body
Updated on June 12, 2022Comments
-
Some Body almost 2 years
Suppose i have a table with 3 fields
Person_id, Name and address. Now the problem is that a person can have multiple addresses. and the principle of atomic values says that data should be atomic.
So then how am i suppose to store multiple addresses for a single person ?