Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9213375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:44:04+00:00 2026-06-18T01:44:04+00:00

I have a tag table like this: TAG ID | TAG_NAME | IMAGE_ID ex:

  • 0

I have a tag table like this:

TAG ID | TAG_NAME | IMAGE_ID 

ex: 
1 | FUNNY | 10 <br />
2 | DOG   | 10
3 | SUNNY | 10 
4 | JULY  | 10 

and I also keep a reference to all the tags associated to an image in the image table

IMAGE_ID | IMAGE_NAME | IMAGE_TAGS ( varchar(255) utf8_general_ci )     

ex: 
10 | dog.jpg | FUNNY,DOG,SUNNY,JULY 

The reasoning for the tag column in the images table, is so that if an image is retrieved, all the associated tags can be retrieved as well without having to dip into the tags table.. but for some reason I’m starting to think it would just be best to get all the associated tags from the tag table to reduce redundancy and to be certain it’s associated with that tag (it could have been removed or deleted but the data doesn’t match) –
but then again I also feel it might be benefical to keep the tags column.. I can’t figure out if I should keep the column or drop it.. am I over thinking this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:44:05+00:00Added an answer on June 18, 2026 at 1:44 am

    Yes, the image_tags column should be removed.

    When you store comma separated data, you will loose all the indexing and integrity goodness that comes with your database engine. This is why it’s considered a sql anti-pattern.

    Your tags table should probably not have the image_id column either. Consider using this schema:

    tags
    ---
    tag_id *
    tag_name
    
    images
    ---
    image_id *
    image_name 
    
    imagetags
    ----
    it_image_id *
    it_tag_id *
    

    The tags for each image are kept in a m:n table imagetags. Foreign key constraints will help to further strengthen the data integrity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: id | id_parent | tag_name 0 | |
I have display tag like this. <display:table class=displayTable id=orgList name=${sessionScope.organisationArray} requestURI= pagesize=13 defaultsort=1 sort=list>
I have an XML field in SQL table like this <Root> <Name>Apollo</Name> <Code>1000</Code> <Code>2000</Code>
I have a code like this - <div id=doc> <div id=main> <table id=vtier#1> <tr>
I have the following setup: Table: Question QuestionId Table: QuestionTag QuestionId TagId Table: Tag
I have a link ( anchor ) tag in a table cell on every
i have 2 tables CREATE TABLE if not exists tag_name( + tagid INTEGER PRIMARY
I have the Demo Table which I can click on the cell(td tag) and
I have a mysql table that have several records linked to one particular tag.
Say I have a table named items : id int(11) ... tag int(11) And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.