Q&A for people interested in the history and origins of science and mathematics
SELECT TagName, ROUND( CAST(PostCount AS DECIMAL) / (SUM(PostCount) OVER ()) * 100, 2 ) AS MarketShare FROM ( SELECT COUNT(*) PostCount, t.TagName AS TagName FROM Posts p JOIN PostTags pt ON p.Id = pt.PostId JOIN Tags t ON pt.TagId = t.Id AND t.TagName IN ( 'oracle', 'sql-server', 'postgresql', 'mysql', 'db2', 'mongodb', 'redis', 'cassandra' ) GROUP BY TagName ) db ORDER BY MarketShare DESC