RSS Forums RSS
Please support our Database Design advertiser: Programming Forums
Views: 925 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 1
Reputation: Jackson776688 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Jackson776688 Jackson776688 is offline Offline
Newbie Poster

Design question?

  #1  
Jul 9th, 2007
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Posts: 3
Reputation: vijayoracle is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vijayoracle vijayoracle is offline Offline
Newbie Poster

Re: Design question?

  #2  
Jul 17th, 2007
You can make composite key on ImageSetId & ImageID. It will solved your problem.

Combination of both fields will be trated as unique.
Reply With Quote  
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,468
Reputation: debasisdas is on a distinguished road 
Rep Power: 4
Solved Threads: 88
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Nearly a Posting Virtuoso

Re: Design question?

  #3  
Jul 24th, 2007
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.
Share your Knowledge.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:17 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC