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 7437967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:28:51+00:00 2026-05-29T10:28:51+00:00

I’m going to make a website to post with tags. Tags can be up

  • 0

I’m going to make a website to post with tags. Tags can be up to five number of tags like at stackoverflow.com.

Can anyone tell the tag system of StackOverflow? The relational database system with post and tag.

Should I add a column in post table or should I create separate tag table for it? Tags can be separated by spaces or comma.

  • 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-05-29T10:28:52+00:00Added an answer on May 29, 2026 at 10:28 am

    Definitely create a table containin the list of available tags.

    You should also definitely create a separate applied tag table containing:

    • Foreign key to your post.
    • Foreign key to your tag.
    • Sequence number
      showing the order.
    • Anything else that might interest you, like who
      added the tag or when it was added.

    You want to use a normalized design because using an denormalized design (adding 5 columns) will break if you ever want to change your business rules to allow fewer or more tags. Also, it doesn’t help you if you have other information to keep, such as when the tag was added and by whom.


    EDIT: DDL

    At the OP’s request:

    CREATE TABLE post (
      id            INTEGER       IDENTITY 
    , title         VARCHAR(1000) NOT NULL
    , added_date    DATETIME      NOT NULL
    , posting_user_id INTEGER     NOT NULL
    , ... (and so forth) ...
    , PRIMARY KEY (id)
    , FOREIGN KEY (posting_user_id) REFERENCES posting_user (id)
    );
    
    CREATE TABLE tag (
      id            INTEGER       IDENTITY
    , term          VARCHAR(20)   NOT NULL
    , description   VARCHAR(1000) NULL
    , ... (and so forth) ....
    , PRIMARY KEY (id)
    );
    
    CREATE TABLE applied_tag (
      post_id       INTEGER       NOT NULL
    , tag_id        INTEGER       NOT NULL
    , display_order INTEGER       NOT NULL
    , tagging_user  INTEGER       NOT NULL
    , applied_date  DATETIME      NOT NULL
    , ... (anything else you want)....
    , PRIMARY KEY (post_id, tag_id_, display_order) -- Or use an auto-increment, but this is unique.
    , FOREIGN KEY (post_id) REFERENCES post (id)
    , FOREIGN KEY (tag_id) REFERENCES tag (id)
    , FOREIGN KEY (tagging_user) REFERENCES posting_user (id)
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported

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.