1

I am working on a "family dictionary" project. I am creating tables in sql server. I am planning to give permission to user to create family, but I can't trust user. He/She can create multiple families.

What is the way to maintain unique family in sql server for several users ? for example:

id    fname    lname    sex    
1     Ashish   Jain      M
2     Neha     Jain      F
3     Sachin   Jain      M

How can I relate these all persons to a family? What process should I use to create a unique family in database?

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
Ashish-BeJovial
  • 1,829
  • 3
  • 38
  • 62

1 Answers1

1

You could have another table 'Family' with an id.

And then from the first table, there would be a foreign key pointing to the family table.

id    fname    lname    sex    familyid
1     Ashish   Jain      M     1
2     Neha     Jain      F     1
3     Sachin   Jain      M     2
Leon Bambrick
  • 26,009
  • 9
  • 51
  • 75