The answer to a similar question was to just ignore the problem. I simply don't buy that's the best answer.
The relevant tables in my database:
- venues (venueid, province, city, venue)
- members (memberid, lastname, firstname, birthday, phone, recruitmentid)
- events (venueid, type, memberid, vip, eventfee, costid, date)
Venueid is an auto_incremented primary key in venues, and the composite of province, city, and venue must be unique or the insert will fail.
It all works, but it bothers me that venueid increases even when the insert fails, so I end up getting primary key gaps. Is there a better way to enforce uniqueness, or maybe the way I'm trying to relate these tables is not best practice, and they should really be combined?