About unique values in tables!!!

b0gdan

Me
Local time
Today, 05:39
Joined
Oct 5, 2006
Messages
29
Hi,
I have a situation and i do not know how to handle it.
I am developing an application for a lawyer. In the data base i have the following tables: Files, the people table (that are involved in a lawsuit), and other tables. The problem is the following: in the people table, beside the primary key i have another unique element that is social security number.
In the files table beside the primary key another unique element exists: the number and date of the file (File 1 from 15.02.2006). A lawsuit file can have more law terms: today it has one law term and maybe next week another law term so i must have the same file many times in the table with the same code and another date, but i cannot add the same file many times in the data base because a file has data about one person and the social security number of the person is unique.

If anyone can offer me a solution it would be good.
Thank you!
 
I'm not sure what your problem is, but here are some thoughts.

In your people table, your Pk is obviously unique. The fact that the SS# is also unique is not a problem. You can, if you like, apply an index to the SS# set to no duplicates, which will prevent a duplicate number being used. Or, you can ignore this. In the UK, our equivalent to the SS# can in rare circumstances be duplicated for valid reasons.

In your files table, you should have a primary key, plus you will be holding a foreign key which is the PK from the people table. As you can have multiple files for one person, the the FK can appear many times in the files table. This presents no problem. I don't see what relevance to SS# has to the files table since it is only the PK from the people table that will be held as the FK.

If the above doesn't help, please explain again and I'll give it another shot!
 
Thanks

Thanks i will examine this because the problem was a relation between files and persons. The problem is that i can`t keep more files with the same person because SS# of a person is unique. I will use your ideea and see what i get.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom