grahamgr3 Posted December 24, 2014 Share Posted December 24, 2014 I have an images table that has 5 foreign keys that reference 5 other tables, each of those tables uses the images table to store images, when an image gets uploaded, the foreign key in question gets a value associated with it in the images table but the other 4 foreign keys will get NULL values in that row. Is that acceptable, or should I rethink my database design? What would be the best way to go? Link to comment Share on other sites More sharing options...
Larry Posted December 26, 2014 Share Posted December 26, 2014 You should rethink your design. Lots of NULL values is generally bad, and you should never have FK columns that are NULL. Link to comment Share on other sites More sharing options...
chop Posted February 23, 2015 Share Posted February 23, 2015 Are you actually storing images is a table or are you storing image URLs? If you are storing images (as blob data) it might be appropriate to ask here about the wisdom of this. From what I've researched it is not advisable as it is too taxing on the performance of the dB. So, if you are redesigning anyway, try keeping the images in your file system and reference by URL. This is as much a question as a suggestion because I know there may be reasons "backing up?" for keeping images in a table. OR It could be that my information is simply outdated by now. Link to comment Share on other sites More sharing options...
Recommended Posts