Problems with NULL-values in foreign key Fields?
Date: 29 May 2002 06:50:19 -0700
I had a problem with the manager of my group because he said that I have to avoid foreign key fields which can be Null in database design. In my books about database design they write that null values in foreign key fields are ok.
Here is the example where the problem rose from:
I have too tables:
- table ip_adresses(ip_adress_id,......) with PK ip_adress_id
- table ip_names(ip_name_id, ip_adress_id, rl_ip_adress_id,.....) with PK ip_name_id
Table ip_names has the
foreign keys ip_adress_id and rl_ip_adress_id which point both to the PK ip_adress_id of the table ip_adresses. I introduced the second foreign key rl_ip_adress_id to mark the reverse-lookup-ip-name of an ip-adress. The foreign key field rl_ip_adress_id can be null because not every ip-name has to be a reverse-lookup ip-name.
For me this design is perfectly all right. If there is a problem where is it??
Daniel Foerderer Received on Wed May 29 2002 - 15:50:19 CEST