2

This is the first time I have tried querying the SO dataset so I may not be doing it correctly.

SELECT CreationDate, ViewCount,  Tags, ClosedDate , id
  FROM Posts

returns to me a datagrid headed thus

enter image description here

which is confirmed when opened locally. Over half the 50,000 rows have no values for ViewCount or Tags.

When I directly enter a specific ID where there is no ViewCount data, such as:

https://stackoverflow.com/questions/27537179 

I get redirected to

Dictionary int:variable(reference) in python

where there are ViewCounts and tags present.

1 Answer 1

4

The Posts table contains all questions and answers (and some other types of posts, like tag wikis). Only questions can have a ViewCount, Tags, and ClosedDate. Answers do not have any of those.

Try modifying your query to only select questions (PostTypeId = 1):

SELECT CreationDate, ViewCount, Tags, ClosedDate, Id
FROM Posts
WHERE PostTypeId = 1
2
  • 1
    As it happens, SO database contains one answer with a tag. A mystery...
    – user259867
    Commented Jan 25, 2015 at 2:21
  • @Fundamental Interesting. Have no idea how that one happened.
    – animuson StaffMod
    Commented Jan 25, 2015 at 2:28

You must log in to answer this question.

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