Background info
As explained here, StackOverflow questions can be closed due to several reasons, namely Duplicate of..., Off-topic because..., Needs details or clarity, Needs more focus and Opinion-based.
Queries are executed on the public StackOverflow Bigquery on Google Cloud Platform. This Bigquery contains, amongst other tables, posts_questions and votes, the first containing all questions and the second contains cast votes on these questions.
posts_questions schema:
id | title | body | accepted_answer_id | answer_count | comment_count | ... |
---|
vote Schema:
id | creation_date | post_id | vote_type_id |
---|
Question
There exist 16 different vote_type_ids and according to this post on Meta, vote_type_id 6 corresponds to a close vote. After three close votes were cast by users, a question appears as closed on StackOverflow. The following query, therefore, returns the id and URL of 10 closed questions.
SELECT q.id, CONCAT('https://stackoverflow.com/questions/', CAST(q.id as STRING)) as url,
FROM `bigquery-public-data.stackoverflow.posts_questions` AS q
JOIN `bigquery-public-data.stackoverflow.votes` AS v
ON q.id = v.post_id
WHERE v.vote_type_id = 6
GROUP BY q.id
HAVING COUNT(*) >= 3
LIMIT 10
My question is, is it possible to query closed questions based on the close vote reason? Like, query 250 questions that were closed due to being duplicates?