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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:37:48+00:00 2026-05-19T17:37:48+00:00

I am creating a database table that’ll have a list of all Tags available

  • 0

I am creating a database table that’ll have a list of all Tags available in my application (just like SO’s tags).

Currently, I don’t have anything associated with each tag (and I’ll probably never have), so my idea was to have something of the form

Tags (Tag(pk) : string)

Should this be the way to do it? Or should I instead do something like

Tags (tag_id(pk) : int, tag : string)

I guess looking up on the table in the 2nd case would be faster than in the first one, but that it also takes up more space?

Thanks

  • 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-19T17:37:49+00:00Added an answer on May 19, 2026 at 5:37 pm

    I’d go for the second option with the surrogate key.

    It will mean the table takes up more space but will likely reduce space over all assuming that you have the tag information as a foreign key in other tables (e.g. a posts/tags table)

    using an int rather than a string will make the lookups required to enforce the foreign key more efficient and mean that updates of tag titles don’t need to affect multiple tables.

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

Sidebar

Related Questions

I'm creating a database table and I don't have a logical primary key assigned
I have an ms-access database called db.mdb and it contains various table. I;m creating
I have a SQL Server 2008 database table that uses uniqueidentifier as a primary
I'm creating a HR database in access 2007 I have a main table of
Here is something that troubles me as I am creating a database table columns.
In my database I have a simple table that contains values showing the basic
I have an ASPX page that is dynamically creating a gridview from a database
hi to all i have a table that is named books and it has
I'm really upset with Hibernate! I have a database table (mysql) that holds parent-child
I have a database table called posts that has 'id, title, slug and content'

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.