Hi. I'm trying to design a POS/inventory/eCommerce website right now, and I've got as far as designing the data structures (i.e., the tables). But I've run into an annoying problem. I have two tables that (IMO) shouldn't be merged into one table, but I'm not really familiar with the ins and outs of the incredibly rare "one-to-one" relationship.
Here are the two tables:
person
uid -- primary key
firstName
lastName
company
address1
address2
city
province
postalCode
country
phone
fax
email
notes
webUser
uid -- primary key
userName
password
email
firstName
lastName
As you can see, there's a lot of redundancy, which I'm not happy with. The e-mail field is repeated, as well as the first and last names.
So why don't I just join the two tables together, you ask? Well, not all people in the database have web sign-ins (in the case of a customer whose info is entered in a POS terminal in the store), and not all web users have mailing/contact info (in the case of administrators or store clerks, who still need to log in so they can have access to the admin pages).
What do you think? I'm stumped. And what table would I put the foreign key on? Would it matter? Should I creat a junction table, or is that only for many-to-many relationships?
TIA,
Paul d'Aoust