Breakdown of Posts w/ Scores of >1, 0 and <1, by Post Type

1

Please login or register to vote for this query.

(click on this box to dismiss)

Percentage breakdowns of all posts of each type with scores above 0, exactly 0, and below 0 respectively. Totals included for reference.

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

SELECT
pt.Name AS 'Type',
COUNT(p.Id) AS 'Total',
CAST(
  ROUND(
    COUNT(CASE WHEN p.Score > 0 THEN 1 ELSE null END)
    / CAST(COUNT(p.Id) AS Float)
    * 100
  , 4) 
  AS nvarchar(7)
) + '%' AS '+',
CAST(
  ROUND(
    COUNT(CASE WHEN p.Score = 0 THEN 1 ELSE null END)
    / CAST(COUNT(p.Id) AS Float)
    * 100
  , 4) 
  AS nvarchar(7)
) + '%' AS '0',
CAST(
  ROUND(
    COUNT(CASE WHEN p.Score < 0 THEN 1 ELSE null END)
    / CAST(COUNT(p.Id) AS Float)
    * 100
  , 4) 
  AS nvarchar(7)
) + '%' AS '-'

FROM Posts p
JOIN PostTypes pt ON p.PostTypeId = pt.Id
GROUP BY pt.Name
ORDER BY COUNT(p.Id) DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results