I need to figure out the best way to update and insert data into the db.

I have 3 tables

room[id, room_num, building, numcomps]
software[id, title, version]
softroom[rid, sid, date]

The site is meant to print out software for a room, example:

=======
Hickory Ridge
HR226
25 computers

Software:
Winamp 3.0
Windows 200
Firefox 1.0.5
===============

Now the confusing part is that software can be in other classrooms so I have to have a drop down menu populating what software is already in db, and then same goes for rooms but what if room already exists, and so does building, but software doesnt exists and then I have to have a new box for that, its just driving me nuts the part that what if its already in db and if it is....

Example:

1. pick building
2. pick room
3. pick software
4. hit go to add software to room

Butttttt what if the room doesnt exist yet, so it doesnt show up in menu and now you have to add it, and what if the software or even the building doesnt exist....