944,156 Members | Top Members by Rank

Ad:
Jul 9th, 2007
0

Design question?

Expand Post »
Hey guys,

I'm currently in the design stage of a database, and have a question of how the keys should be set up in two of my tables.

I have an Orders table, which is related to a Customers table, and also to an Images table.
The orders table has OrderID (PK), CustID (FK), and ImageSetID (PK)

The ImageSetID field joins to the Images table which contains ImageSetID (FK), ImageID (PK), and ImagePath

Now, I plan to have multiple images for each order, which all will have a common ImageSetID, and each individual image will have an Unique ImageID.
And I plan to store all the image paths in one table.

Example:

ImageSetId - ImageID - ImagePath
---------------------------------------------------
001 - 001 - C:\Pictures
001 - 002 - C:\Pictures
002 - 001 - C:\Pictures
002 - 002 - C:\Pictures
002 - 003 - C:\Pictures

Now, am I wondering.. Am I able to Have a unique ImageID, relating to the ImageSetID?
But, while still using the same ImageID, but for a different ImageSetID..

The way I plan to use input the data, is by creating a new order, then importing images into that order, but for the ImageSetID to stay the same while I am in the same order, but for the ImageID to change.

If that is not possible, any there any suggestions to how to set that up?

Anything would be appreciated, thank you.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jackson776688 is offline Offline
1 posts
since Jul 2007
Jul 17th, 2007
0

Re: Design question?

You can make composite key on ImageSetId & ImageID. It will solved your problem.

Combination of both fields will be trated as unique.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vijayoracle is offline Offline
3 posts
since Jun 2007
Jul 24th, 2007
0

Re: Design question?

Try to establish a composit key using keys specified as suggested in the previous post.

If you still have any doubts ,please do post back.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: Database design regarding two 'linking' tables
Next Thread in Database Design Forum Timeline: tag system





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC