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

  • Home
  • SEARCH
  • 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 6473467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:28:12+00:00 2026-05-25T06:28:12+00:00

For my website, I want to make something that works a bit like the

  • 0

For my website, I want to make something that works a bit like the tags on Stackoverflow – so some fields will have an autocompleter, and the autocompleter will display the number of times that other users have selected each suggested value. I suppose I’d have a database structure like this:

Articles
    ArticleID
    Content
    TagId

Tags
    TagId
    TagName
    Occurances

With the idea being that Occurances represents the number of times each TagId is referenced from the Articles table.

What is the best way to implement this? I could add/subtract from the occurances column on each of the stored procedures that update the article table, but I might miss one, and anyway, there is are some difficulties with this if a user removes a tag from something (as its easy to add 1 to the field for the newly added tag, but harder to work out which tag is being replaced.)

There is lots I don’t understand about sql-server. Is there a more robust way of counting occurances like this, that the database system will deal with itself? It would be ok if the data was cached once a day or something.

  • 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-25T06:28:13+00:00Added an answer on May 25, 2026 at 6:28 am

    You could use this query to get the number of occurances by tag:

    SELECT Tags.TagId, COUNT(Articles.TagId) as Occurances
      FROM Articles
      JOIN Tags ON Articles.TagId
      GROUP BY Tags.TagId
    

    It could be used in a view or stored procedure, and you can set up your website’s cache to requery it as often as required.

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

Sidebar

Related Questions

I want to make a website on the lines of stackoverflow. I need some
I want to make an html5 website that will allow others to play mobile
I have an application built that works like a form, it takes four fields
I have this website I am designing and I want to make it to
So i have a bit of a problem, on my ASP.Net website i want
I have an html5 website, and I want to make sure it gracefully degrades
Suppose I want to make a webpage that takes domain name of a website
I want to make website in multiple languages, I do it right with cookies
I want to make a website in cakephp framework.but the important thing is I
I want to make one website for all PC, IPhone, Blackberry, Windows Mobile (IE

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.