Hi Newsgroup
Does anyone here care to share their thoughts/experiences with using
masking? I am storing categories of books which libraries stock, so that I
might have codes:
015-000-000 = Languages
015-001-000 = European languages
015-001-001 = English
015-001-002 = German
015-001-003 = French
....
etc
This lets me use criteria such as LIKE "015-001-???" when I want to find
libraries which have books on any European language.
Typically, I use non-meaningful autonumber ID columns for a primary key so I
might have:
tblLibraries: LibID, LibName, LibAddress, etc
tblSubjects: SubID, SubName, SubMask
tblLibrarySubjects: LibID, SubID (the junction table)
However, if I simply store the SubID in the junction table, I will always
need to have a query using a join from the subjects table if I need LIKE
"015-001-???". I could use this mask as the primary key in the subjects
table and save myself a join. Another benefit might be that by enforcing
cascade updates, re-classifying a subject would be easier - eg I could
change its place in the hierarchy. What do you think? Also, should the
junction table have its own PK if the 2 primary keys from the other tables
already form a unique index?
Thanks for any thoughts