Click here to Skip to main content
15,912,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm designing my database structure and i need some advice: i have images that can be selected from categories and others can be uploaded and for every buddy i should save what image was selected...

i have several options:

1-i can put the uploaded images and the predefined images into the same table and put a flag to differentiate between them, and i know that using flags might be risky..

2-i can put the uploaded images and the predefined images into 2 different tables but in that case if i need to put the id of the image selected in the buddy table i will not be able to know from which table this id was given (because the image id is an incremented integer)

so how can i design this? and which method is better and why?
Posted
Comments
[no name] 15-Oct-13 1:42am    
I prefer the first option. With two tables, it's not as easy for future operations like image retrival, editing etc. Also, it's not so cost effective to maintain two tables of same structure.

1 solution

Hi Jocelyne,

I hope 2nd method my be take more burden on the sql server as we think from performance perspective and it will take more code to developer while developing the application. 1st method is most preferable instead of 2nd.

Thanks,

Coded007
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900