I want to extract question tags in stack overflow and the number of questions of each tags. I read this post Is there a way to extract statical information based on tags?. The answer shows I can get it by running query in http://data.stackexchange.com/. But I do not know how to compose the query to extract all the tags and their number of questions. Could anyone show one how to compose that query ?


For many common queries, there's little need to compose a query. Instead, use the search feature on data.SE to find existing queries that suit your needs. This search for example, finds some queries that pull the number of questions per tag for the last month, or 6 months. Clicking on the one that pulls questions per tag for last 6 months gets us a nice query that does what the label on the tin says.

If you want to generalize this query to do all questions ever, then click the fork this query link on that page, and remove the line: (be sure to update the comment and title of the query)

and p.creationDate >  DATEADD(Month, -6, DATEADD(dd, DATEDIFF(dd, 0, getdate()), 0) )

If you want to sort it by the number of questions, add this to the end:


The Data Explorer uses MS SQL, so if you want more information on what all the pieces of the query do, do some googling on MS SQL syntax. The schema is outlined in the sidebar on the page you get when you fork a query or compose a new query.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .