Right, I'm building a db for a beer festival using MySQL. The tables I ve got are as follows:
--brewery(bid, name, address, phone, region, notes)
--wholesaler(wid, name, address, phone)
--order(ordered, status, dateordered, datedelivered, method, sid)
--beer(caskid, name, ABV, size, category, notes, bar, position, bid, orderid, tripid)
--trip(tripid, destination, tripdate)
foreign keys: sid can be either bid or wid, bid links brewery to beer and tripid links beer to trip.
The problem I have is that I want to avoid using NULL foreign keys (

)as they can cause weird joining problems, and the foreign keys orderid and trip in beer may be NULL - A beer may not be on an order and a beer may not be on a trip. The db books Im reading say that NULLS should be avoided "if at all possible"...
I decided to use intermedate tables to model these troublesome relationships (like many to many relationship tables) and will enforce constraints on updates so a beer can only be entered into these tables only once (to make the relationship 1 to many rather than many to many).
Can anyone suggest a solution or comment on mine?
Cheers in advance.
J