I’m putting together a database to manage image files located on a file server. As I’m new to the database world, I’m torn between using one table, or two. Here’s the breakdown:
I’m needing columns for: imgId, imgTitle, imgClass, imgFamily, and imgURL.
I’m wondering if it would be better to put the imgURL in another table with imgID linking the two, or if they can all be together in one table, and function fine.
What do you think?
All of the items that you have stated appear to have a one to one relationship; in other words, you’re probably not going to have two different URLs for one title or image id.
However, the other thing to consider is whether any of the fields are likely to be empty fairly often; would a lot of them have no class, for example, or family? If that was the case, you could consider putting that data in a separate table and linking to it using the id:
You would then get your data using a LEFT JOIN, which would therefore get you the data in image even if there were no row in imageAddendum: