I have a situation where I am creating a table that needs a triple field primary key. However, one of the fields may be null. I do not believe you can have a null field part of the primary key? I am using mysql as the DB enviornment. I am creating a hotel like structure where a room can be in a particular tower (3 choices), and each room can change type depending on setup. The rooms are also designated by number based on tower and inside each room there can be up to 4 different sides which need to be associated with a particular person occupying the room. If anyone can help me with this or if you need further information please let me know.
Thanks for everyones help. The structure for the two tables involved looks something like:
Building (3 choices, PK)
Side (A, AA, B, BB, also PK, but some rooms do not have sides so this can be null.
Type (Many types can change affecting number of sides.)
I think I may have figured it out, but any more help would be appreciative. The idea is there is a room say Building K room 100 side A and there is a room say Building K room 100 side B. I need to be able to associate the correct room number and correct side with a person. Each year the type of room can change to create either 2 or 4 spaces. Some rooms are completely private and have no sides (hence the null problem.