loconet
06-29-02, 14:45
| I'm just getting by feet wet in real world examples on DB design and I've come across this probably basic problem that I'd like some advise from you guys.... i have an online magazine as a product that can have: - subscriptionLengthID (autonumber) (ie: monthly, bi monthly, yearly, etc) - a licenseID (autonumber) (how many users can access the online magazine for one subscription ie: Individual: 1 user, Commercial: 20-30 users, etc) - magazineFamilyTypeID: (autonumber) (ie: a classic normal, a feature magazine, a special edition, etc) In addition... there is a price field for the product which is decided by the magazine author at the moment it is released, which is pretty much content dependant & dependant on all of the other 3 ids. The way i have it set up so far is that all of this information is on a detailed_product table .. detailed_product (subscriptionLengthID,magazineFamilyTypeID, LicenseID, price, releaseDate) Is there a *clean* way to use that composite key as a foreign key on a different table without having to use the 3 numbers every time? I was thinking something like an auto_number representing the combination (a Surrogate key) , but that breaks the proper normalization correct? Another idea i tried to implement was that of having the key maded up of the 3 other something like: id1-id2-id3 ., but that seems to stop me from having a *theorical* unlimited number of entries on the detailed_product table :( Any suggestions or other resources I should look up/read would be of great help Thanks in advance |