Questions tagged [data.stackexchange.com]

The Stack Exchange Data Explorer is a tool used to look at the data from Stack Exchange websites using SQL queries.

19 questions
4
votes
2 answers

How can I make my SQL query for StackExchange shorter?

I was trying to track my performance here in SO using StackExchange - Query Stack Overflow and came up with this query: At first I have this one to get the list of my answered questions: Select Distinct a.Id, a.CreationDate, u.DisplayName, p.Title,…
tomjosef
  • 895
  • 6
  • 21
2
votes
1 answer

Most efficient way to query stack overflow database for a question and its answers

So I'm trying to query the stack overflow database for a question and its answers. So far I have come across two ways to do this: SELECT questions.Id as [Post Link], questions.title, answers.body, questions.viewcount FROM Posts answers INNER JOIN…
j.doe
  • 305
  • 3
  • 16
2
votes
1 answer

CLI to StackExchange Data Explorer

I'm starting to use the StackExchange Data Explorer, which is a cool tool. Apart from the web interface, is there a CLI way to connect to the StackExchange SQL engine without downloading the whole data dump to a local SQL database. What I want to do…
2
votes
1 answer

How to assign event counts to relative date values in SQL?

I want to line up multiple series so that all milestone dates are set to month zero, allowing me to measure the before-and-after effect of the milestone. I'm hoping to be able to do this using SQL server. You can see an approximation of what I'm…
samthebrand
  • 3,020
  • 7
  • 41
  • 56
1
vote
1 answer

Use SQL count(*) with an alias column

Hi I'm trying to use https://data.stackexchange.com/stackoverflow/query/new to get the stack overflow gold medalists from my country. Here is my query, SELECT TOP 1000 ROW_NUMBER() OVER(ORDER BY Gold badges DESC) AS [#], UserId AS [User Link],…
vimuth
  • 5,064
  • 33
  • 79
  • 116
1
vote
1 answer

Assign default value 6 months in the past to datetime variable on data.stackexchange.com

I found a query on data.stackexchange.com (Interesting unanswered questions) and wanted to make a variation with an optional datetime variable to avoid getting questions that are very old in the results. I hard coded a date six months in the past…
JoSSte
  • 2,953
  • 6
  • 34
  • 54
1
vote
1 answer

Generalize SQL query to include data for all Users

This popular data.stackexchange.com query allows me to query all tags of a user combined with their upvotes. E.g. for user 22656 the follwing is outputed: TagName, Upvotes c#, 147346 java, 84373 .net, 49952 I would like to extract this information…
styts
  • 1,003
  • 1
  • 8
  • 19
1
vote
1 answer

Why does this search for [help/dont-ask] return irrelevant results in DSE?

Why does this ridiculously simple query on data.stackexchange.com return results that don't have [help/dont-ask] in the comment text? I feel like I'm missing something mind-numbingly obvious here. select top 10 Id, PostId, Text from comments where…
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
0
votes
0 answers

Are there 1:M Recursive relationships in the StackExchange Database?

I'm looking for a 1 to many recursive relationship in the Stack Exchange Database. I'm querying it here https://data.stackexchange.com/math/queries. I don't see any 1 to many recursive relationships. The closest I've found is the relationship…
Eric Tim
  • 53
  • 8
0
votes
0 answers

Do we know which columns in StackExchange tables are indexed?

Is there a way to tell which columns are indexes (other than the primary keys) in the Stack Exchange database? I can look at the link below, but that doesn't explicitly answer the question, as far as I can tell. https://sedeschema.github.io/
Eric Tim
  • 53
  • 8
0
votes
1 answer

Why does Location=emptystring occupy two rows on "GROUP BY Location" on a data.stackexchange query?

Why does Location=emptystring occupy two rows on this data.stackexchange query? https://data.stackexchange.com/stackoverflow/query/1627756/test SELECT SUM(Reputation) AS rep, Location FROM Users GROUP BY Location ORDER BY rep DESC
hanshenrik
  • 19,904
  • 4
  • 43
  • 89
0
votes
0 answers

Cypress does not open "https://worldbuilding.stackexchange.com" . Why it happens?

I tried to click on that link in stackexchange.com at first and received "Whoops, there is no test to run." info. Then tried to directly open the link, it behaves same. I used invoke('attr', 'target', '_self') and "experimentalSourceRewriting": true…
Solufer
  • 21
  • 1
  • 3
  • 7
0
votes
1 answer

query stackoverflow questions by language and date?

I see that we have a tool called "stack exchange data query" but I don't see there examples of using the tool and I don't see in the fields "programming language" or something similar?
David Peer
  • 150
  • 1
  • 1
  • 12
0
votes
3 answers

Get number of posts per month in data.stackexchange

I'm trying to get the total monthly number of posts per month WITH QuestStatsByMonth AS ( SELECT DATEADD (month, DATEDIFF (month, 0, q.CreationDate), 0) AS [Month], t.TagName, SUM (q.Score) AS TotalScore, q.Id …
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
0
votes
1 answer

SQL - Optimize the execution time

I am trying to fetch data from stackexchange database. My query is: select distinct top 50 U.Id, U.DisplayName, U.Reputation, Tags = stuff( (SELECT ','+p2.Tags FROM posts p2 join votes V on p2.id = V.PostId …
Leo Li
  • 73
  • 1
  • 3
  • 10
1
2