Distribution of score vs. number of bookmarks (log-log)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS

Q&A for administrators, end users, developers and designers for Craft CMS

WITH Scores AS (SELECT Score AS n, COUNT(*) AS c
  FROM Posts
  WHERE PostTypeId = 1 -- questions
  GROUP BY Score),

Bookmarks AS (SELECT COALESCE(FavoriteCount, 0) AS n, COUNT(*) AS c
  FROM Posts
  WHERE PostTypeId = 1 -- questions
  GROUP BY COALESCE(FavoriteCount, 0))

SELECT LOG(Scores.n, 10),
  IIF(Scores.c > 0, LOG(Scores.c, 10), -1),
  IIF(Bookmarks.c > 0, LOG(Bookmarks.c, 10), -1)
  FROM Scores INNER JOIN Bookmarks
    ON Scores.n = Bookmarks.n
  WHERE Scores.n > 0
  ORDER BY Scores.n

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results