I've been reading a lot about the various database keys recently and have a good grasp on them.
- Primary key - should be something unique and immutable, no nulls allowed
- Unique key - should be something unique, but can change and have nulls
- Foreign key - ties a column/columns in a child table to a parent table's primary/unique key
Makes perfect sense. But one thing that I'm wondering about is why would you ever have more than one unique key? I can't think of any examples where that would be desirable.
edit: also, allowing nulls in a unique key and then using it in a foreign key is just weird. The child insert succeeds but you effectively orphan your child rows. This is all with Oracle, btw.